Exemplo n.º 1
0
 public Modifier(TypeDefinition type, string assembly)
 {
     Name           = $"{type.FullName}";
     Type           = ModifierType.Type;
     TypeName       = type.FullName;
     AssemblyName   = assembly;
     Signature      = Utility.GetModifierSignature(type);
     TargetExposure = Signature.Exposure;
     if (type.IsAbstract && type.IsSealed)
     {
         List <Exposure> temp = TargetExposure.ToList();
         temp.Add(Exposure.Static);
         TargetExposure = temp.ToArray();
     }
     MSILHash = string.Empty;
 }
Exemplo n.º 2
0
 public Modifier(MethodDefinition method, string assembly)
 {
     Name           = $"{method.DeclaringType}::{method.Name}";
     Type           = ModifierType.Method;
     TypeName       = method.DeclaringType.FullName;
     AssemblyName   = assembly;
     Signature      = Utility.GetModifierSignature(method);
     TargetExposure = Signature.Exposure;
     if (method.IsStatic)
     {
         List <Exposure> temp = TargetExposure.ToList();
         temp.Add(Exposure.Static);
         TargetExposure = temp.ToArray();
     }
     MSILHash = new ILWeaver(method.Body).Hash;
 }
Exemplo n.º 3
0
 public Modifier(PropertyDefinition property, string assembly)
 {
     Name           = $"{property.DeclaringType}::{property.Name}";
     Type           = ModifierType.Property;
     TypeName       = property.DeclaringType.FullName;
     AssemblyName   = assembly;
     Signature      = Utility.GetModifierSignature(property);
     TargetExposure = Signature.Exposure;
     if ((property.GetMethod == null || property.GetMethod.IsStatic) && (property.SetMethod == null || property.SetMethod.IsStatic))
     {
         List <Exposure> temp = TargetExposure.ToList();
         temp.Add(Exposure.Static);
         TargetExposure = temp.ToArray();
     }
     MSILHash = string.Empty;
 }
Exemplo n.º 4
0
 public Modifier(FieldDefinition field, string assembly)
 {
     Name           = $"{field.DeclaringType}::{field.Name}";
     Type           = ModifierType.Field;
     TypeName       = field.DeclaringType.FullName;
     AssemblyName   = assembly;
     Signature      = Utility.GetModifierSignature(field);
     TargetExposure = Signature.Exposure;
     if (field.IsStatic)
     {
         List <Exposure> temp = TargetExposure.ToList();
         temp.Add(Exposure.Static);
         TargetExposure = temp.ToArray();
     }
     MSILHash = string.Empty;
 }