public static OverloadsCollection Create(IEmitter emitter, CustomEventDeclaration eventDeclaration, bool remove) { string key = eventDeclaration.GetHashCode().ToString() + remove.GetHashCode().ToString(); if (emitter.OverloadsCache.ContainsKey(key)) { return emitter.OverloadsCache[key]; } return new OverloadsCollection(emitter, eventDeclaration, remove); }
public static OverloadsCollection Create(IEmitter emitter, CustomEventDeclaration eventDeclaration, bool remove) { string key = eventDeclaration.GetHashCode().ToString() + remove.GetHashCode().ToString(); if (emitter.OverloadsCache.ContainsKey(key)) { return(emitter.OverloadsCache[key]); } return(new OverloadsCollection(emitter, eventDeclaration, remove)); }
private OverloadsCollection(IEmitter emitter, CustomEventDeclaration eventDeclaration, bool remove) { this.Emitter = emitter; this.Name = eventDeclaration.Name; this.JsName = Helpers.GetEventRef(eventDeclaration, emitter, remove, true); this.Inherit = !eventDeclaration.HasModifier(Modifiers.Static); this.CancelChangeCase = true; this.IsSetter = remove; this.Static = eventDeclaration.HasModifier(Modifiers.Static); this.Member = this.FindMember(eventDeclaration); this.TypeDefinition = this.Member.DeclaringTypeDefinition; this.Type = this.Member.DeclaringType; this.InitMembers(); this.Emitter.OverloadsCache[eventDeclaration.GetHashCode().ToString()] = this; }
private OverloadsCollection(IEmitter emitter, CustomEventDeclaration eventDeclaration, bool remove) { this.Emitter = emitter; this.Name = eventDeclaration.Name; this.JsName = Helpers.GetEventRef(eventDeclaration, emitter, remove, true); this.AltJsName = Helpers.GetEventRef(eventDeclaration, emitter, !remove, true); this.Inherit = !eventDeclaration.HasModifier(Modifiers.Static); this.CancelChangeCase = true; this.IsSetter = remove; this.Static = eventDeclaration.HasModifier(Modifiers.Static); this.Member = this.FindMember(eventDeclaration); this.TypeDefinition = this.Member.DeclaringTypeDefinition; this.Type = this.Member.DeclaringType; this.InitMembers(); this.Emitter.OverloadsCache[eventDeclaration.GetHashCode().ToString() + remove.GetHashCode().ToString()] = this; }