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; }
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; }
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; }
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; }