protected override void GetMethods(out DmdMethodInfo getMethod, out DmdMethodInfo setMethod, out DmdMethodInfo[] otherMethods) { var info = COMThread(GetMethods_COMThread); getMethod = info.getMethod; setMethod = info.setMethod; otherMethods = info.otherMethods; }
protected override void GetMethods(out DmdMethodInfo addMethod, out DmdMethodInfo removeMethod, out DmdMethodInfo raiseMethod, out DmdMethodInfo[] otherMethods) { var info = COMThread(GetMethods_COMThread); addMethod = info.addMethod; removeMethod = info.removeMethod; raiseMethod = info.raiseMethod; otherMethods = info.otherMethods; }
protected override void GetMethods(out DmdMethodInfo addMethod, out DmdMethodInfo removeMethod, out DmdMethodInfo raiseMethod, out DmdMethodInfo[] otherMethods) { addMethod = null; removeMethod = null; raiseMethod = null; List <DmdMethodInfo> otherMethodsList = null; var ridList = reader.Metadata.GetMethodSemanticsRidList(Table.Event, Rid); for (int i = 0; i < ridList.Count; i++) { if (!reader.TablesStream.TryReadMethodSemanticsRow(ridList[i], out var row)) { continue; } var method = ReflectedType.GetMethod(Module, 0x06000000 + (int)row.Method) as DmdMethodInfo; if ((object)method == null) { continue; } switch ((MethodSemanticsAttributes)row.Semantic) { case MethodSemanticsAttributes.AddOn: if ((object)addMethod == null) { addMethod = method; } break; case MethodSemanticsAttributes.RemoveOn: if ((object)removeMethod == null) { removeMethod = method; } break; case MethodSemanticsAttributes.Fire: if ((object)raiseMethod == null) { raiseMethod = method; } break; case MethodSemanticsAttributes.Other: if (otherMethodsList == null) { otherMethodsList = new List <DmdMethodInfo>(); } otherMethodsList.Add(method); break; } } otherMethods = otherMethodsList?.ToArray(); }
static object GetColor(DmdMethodInfo method, object staticValue, object instanceValue) { if ((object)method == null) { return(instanceValue); } if (method.IsStatic) { return(staticValue); } return(instanceValue); }
static DbgTextColor GetColor(DmdMethodInfo method, DbgTextColor staticValue, DbgTextColor instanceValue) { if ((object)method == null) { return(instanceValue); } if (method.IsStatic) { return(staticValue); } return(instanceValue); }
public PreserveSigAttributeInfo(DmdMethodInfo method) { if ((method.MethodImplementationFlags & DmdMethodImplAttributes.PreserveSig) != 0) { var caType = method.AppDomain.GetWellKnownType(DmdWellKnownType.System_Runtime_InteropServices_PreserveSigAttribute, isOptional: true); ctor = caType?.GetConstructor(Array.Empty <DmdType>()); Debug.Assert((object)caType == null || (object)ctor != null); } else { ctor = null; } }
protected override void GetMethods(out DmdMethodInfo getMethod, out DmdMethodInfo setMethod, out DmdMethodInfo[] otherMethods) { getMethod = null; setMethod = null; List <DmdMethodInfo> otherMethodsList = null; var ridList = reader.Metadata.GetMethodSemanticsRidList(Table.Property, Rid); for (uint i = 0; i < ridList.Length; i++) { var row = reader.TablesStream.ReadMethodSemanticsRow(ridList[i]); var method = ReflectedType.GetMethod(Module, 0x06000000 + (int)row.Method) as DmdMethodInfo; if ((object)method == null) { continue; } switch ((MethodSemanticsAttributes)row.Semantic) { case MethodSemanticsAttributes.Setter: if ((object)setMethod == null) { setMethod = method; } break; case MethodSemanticsAttributes.Getter: if ((object)getMethod == null) { getMethod = method; } break; case MethodSemanticsAttributes.Other: if (otherMethodsList == null) { otherMethodsList = new List <DmdMethodInfo>(); } otherMethodsList.Add(method); break; } } otherMethods = otherMethodsList?.ToArray(); }
public static DmdMethodInfo?FilterAccessor(DmdGetAccessorOptions options, DmdMethodInfo method) { if ((options & DmdGetAccessorOptions.All) != 0) { return(method); } if (method is null) { return(null); } if (method.IsPrivate && (object?)method.DeclaringType != method.ReflectedType) { return(null); } if (method.IsPublic || (options & DmdGetAccessorOptions.NonPublic) != 0) { return(method); } return(null); }
protected abstract void GetMethods(out DmdMethodInfo addMethod, out DmdMethodInfo removeMethod, out DmdMethodInfo raiseMethod, out DmdMethodInfo[] otherMethods);
internal DmdMethodInfo SetParentDefinition(DmdMethodInfo method) => parentDefinition = method;
public ToStringState(DmdMethodInfo toStringMethod) => ToStringMethod = toStringMethod;
protected abstract void GetMethods(out DmdMethodInfo getMethod, out DmdMethodInfo setMethod, out DmdMethodInfo[] otherMethods);
/// <summary> /// Constructor /// </summary> /// <param name="id">Return value id</param> /// <param name="method">Method</param> /// <param name="value">Value returned by <paramref name="method"/></param> public DbgDotNetReturnValueInfo(uint id, DmdMethodInfo method, DbgDotNetValue value) { Id = id; Method = method ?? throw new ArgumentNullException(nameof(method)); Value = value ?? throw new ArgumentNullException(nameof(value)); }