public static OverloadsCollection Create(IEmitter emitter, EventDeclaration eventDeclaration)
        {
            string key = eventDeclaration.GetHashCode().ToString();
            if (emitter.OverloadsCache.ContainsKey(key))
            {
                return emitter.OverloadsCache[key];
            }

            return new OverloadsCollection(emitter, eventDeclaration);
        }
Esempio n. 2
0
        public static OverloadsCollection Create(IEmitter emitter, EventDeclaration eventDeclaration)
        {
            string key = eventDeclaration.GetHashCode().ToString();

            if (emitter.OverloadsCache.ContainsKey(key))
            {
                return(emitter.OverloadsCache[key]);
            }

            return(new OverloadsCollection(emitter, eventDeclaration));
        }
        public void Equality_ReallyEquals()
        {
            var a = new EventDeclaration {
                Name = SomeEvent
            };
            var b = new EventDeclaration {
                Name = SomeEvent
            };

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
Esempio n. 4
0
 private OverloadsCollection(IEmitter emitter, EventDeclaration eventDeclaration)
 {
     this.Emitter          = emitter;
     this.Name             = emitter.GetEventName(eventDeclaration);
     this.JsName           = this.Emitter.GetEntityName(eventDeclaration, false, true);
     this.Inherit          = !eventDeclaration.HasModifier(Modifiers.Static);
     this.Static           = eventDeclaration.HasModifier(Modifiers.Static);
     this.CancelChangeCase = true;
     this.Member           = this.FindMember(eventDeclaration);
     this.TypeDefinition   = this.Member.DeclaringTypeDefinition;
     this.Type             = this.Member.DeclaringType;
     this.InitMembers();
     this.Emitter.OverloadsCache[eventDeclaration.GetHashCode().ToString()] = this;
 }
Esempio n. 5
0
 private OverloadsCollection(IEmitter emitter, EventDeclaration eventDeclaration)
 {
     this.Emitter = emitter;
     this.Name = emitter.GetEventName(eventDeclaration);
     this.JsName = this.Emitter.GetEntityName(eventDeclaration, false, true);
     this.Inherit = !eventDeclaration.HasModifier(Modifiers.Static);
     this.Static = eventDeclaration.HasModifier(Modifiers.Static);
     this.CancelChangeCase = true;
     this.Member = this.FindMember(eventDeclaration);
     this.TypeDefinition = this.Member.DeclaringTypeDefinition;
     this.Type = this.Member.DeclaringType;
     this.InitMembers();
     this.Emitter.OverloadsCache[eventDeclaration.GetHashCode().ToString()] = this;
 }