Browse Source

Change whitelist injection into blacklist injection

tags/1.0-rc
james7132 8 years ago
parent
commit
f1df412341
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      src/Discord.Net.Commands/Attributes/DontInjectAttribute.cs
  2. +1
    -1
      src/Discord.Net.Commands/Utilities/ReflectionUtils.cs

src/Discord.Net.Commands/Attributes/InjectAttribute.cs → src/Discord.Net.Commands/Attributes/DontInjectAttribute.cs View File

@@ -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 {
} }


} }

+ 1
- 1
src/Discord.Net.Commands/Utilities/ReflectionUtils.cs View File

@@ -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) =>


Loading…
Cancel
Save