Change whitelist injection into blacklist injection
This commit is contained in:
@@ -3,7 +3,7 @@ using System;
|
|||||||
namespace Discord.Commands {
|
namespace Discord.Commands {
|
||||||
|
|
||||||
[AttributeUsage(AttributeTargets.Property)]
|
[AttributeUsage(AttributeTargets.Property)]
|
||||||
public class InjectAttribute : Attribute {
|
public class DontInjectAttribute : Attribute {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,7 @@ namespace Discord.Commands
|
|||||||
var constructor = constructors[0];
|
var constructor = constructors[0];
|
||||||
System.Reflection.ParameterInfo[] parameters = constructor.GetParameters();
|
System.Reflection.ParameterInfo[] parameters = constructor.GetParameters();
|
||||||
System.Reflection.PropertyInfo[] properties = typeInfo.DeclaredProperties
|
System.Reflection.PropertyInfo[] properties = typeInfo.DeclaredProperties
|
||||||
.Where(p => p.CanWrite && p.GetCustomAttribute<InjectAttribute>() != null)
|
.Where(p => p.CanWrite && p.GetCustomAttribute<DontInjectAttribute>() == null)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
return (map) =>
|
return (map) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user