private bool EqualsEvent(IEventSignature x, IEventSignature y) { if (x == y) { return(true); } if (x == null || y == null) { return(false); } if (x.Name != y.Name) { return(false); } if (!EqualsType(x.EventType, y.EventType)) { return(false); } if (!EqualsType(x.Owner, y.Owner)) { return(false); } return(true); }
protected bool Equals(IEventSignature x, IEventSignature y, bool canIgnoreOwner) { if (x == y) { return(true); } if (x == null || y == null) { return(false); } if (x.Name != y.Name) { return(false); } if (!Equals(x.EventType, y.EventType, false)) { return(false); } if (!canIgnoreOwner || (_flags & SignatureComparisonFlags.IgnoreMemberOwner) != SignatureComparisonFlags.IgnoreMemberOwner) { if (!Equals(x.Owner, y.Owner, canIgnoreOwner)) { return(false); } } return(true); }
private void WriteEvent(ref int pos, IEventSignature e) { _blob.Write(ref pos, (byte)SignatureType.Event); WriteString(ref pos, e.Name); var owner = e.Owner; bool writeOwner = (owner != null); _blob.Write(ref pos, (bool)writeOwner); int addLength = 4; if (writeOwner) { addLength += 4; } _blob.Length += addLength; if (writeOwner) { WriteReferenced(ref pos, owner); } WriteReferenced(ref pos, e.EventType); }
public static string ToString(this IEventSignature eventSig, IModule module = null, SignaturePrintingFlags flags = SignaturePrintingFlags.None) { var printer = new SignaturePrinter(flags); printer.PrintEvent(eventSig, module); return(printer.ToString()); }
internal bool Equals(IEventSignature x, IEventSignature y) { if (x.Name != y.Name) { return(false); } if (!EqualsType(x.EventType, y.EventType)) { return(false); } return(true); }
public IEvent Resolve(IEventSignature eventSig, ICodeNode context, bool throwOnFailure = false) { var e = ResolveEvent(eventSig, context.Module, context); if (e == null) { if (throwOnFailure) { throw new ResolveReferenceException(string.Format(SR.EventResolveError, eventSig.ToString())); } return(null); } return(e); }
protected int GetHashCode(IEventSignature obj, bool canIgnoreOwner) { int hashCode = 0x10000; if (obj.Name != null) { hashCode ^= obj.Name.GetHashCode(); } if (!canIgnoreOwner || (_flags & SignatureComparisonFlags.IgnoreMemberOwner) != SignatureComparisonFlags.IgnoreMemberOwner) { var owner = obj.Owner; if (owner != null) { hashCode ^= GetHashCode(owner, canIgnoreOwner); } } return(hashCode); }
public void PrintEvent(IEventSignature eventSig, IModule module) { if ((_flags & SignaturePrintingFlags.IgnoreMemberOwner) != SignaturePrintingFlags.IgnoreMemberOwner) { var owner = eventSig.Owner; if (owner != null) { PrintType(owner, module); } else { _builder.Append(CodeModelUtils.GlobalTypeName); } _builder.Append("::"); } PrintIdentifier(eventSig.Name); _builder.Append(" : "); PrintType(eventSig.EventType, module, false); }
protected IEvent ResolveEvent(IEventSignature eventSig, IModule context, ICodeNode genericContext) { var ownerType = ResolveType(eventSig.Owner, context, genericContext); if (ownerType == null) { return(null); } var comparer = new ResolveSignatureComparer(context, ownerType.Module); // Find foreach (var e in ownerType.Events) { if (comparer.Equals(eventSig, e.DeclaringEvent)) { return(e); } } return(null); }
public static IEvent Resolve(this IEventSignature eventSig, ICodeNode context, bool throwOnFailure = false) { return(context.AssemblyManager.Resolve(eventSig, context, throwOnFailure)); }
public int GetHashCode(IEventSignature obj) { return(GetHashCode(obj, true)); }
public bool Equals(IEventSignature x, IEventSignature y) { return(Equals(x, y, true)); }