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);
        }
Beispiel #2
0
        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));
        }
Beispiel #3
0
 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;
 }
Beispiel #4
0
 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;
 }