Ejemplo n.º 1
0
        public AbcTrait DefineSlot(object name, object type, bool isStatic)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

            var traitName = Abc.DefineName(name);

            var traits = isStatic ? Class.Traits : Traits;
            var trait  = traits.Find(traitName, AbcTraitKind.Slot);

            if (trait != null)
            {
                return(trait);
            }

            var typeName = Abc.DefineTypeNameSafe(type);

            trait = AbcTrait.CreateSlot(typeName, traitName);
            traits.Add(trait);

            return(trait);
        }
Ejemplo n.º 2
0
        public AbcTrait CreateSlot(object type, object name)
        {
            var typeName = DefineTypeNameSafe(type);
            var mn       = DefineName(name);

            return(AbcTrait.CreateSlot(typeName, mn));
        }
Ejemplo n.º 3
0
        public AbcTrait CreateSlot(object name, object type, bool isStatic)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

            var traitName = Abc.DefineName(name);
            var typeName  = Abc.DefineTypeNameSafe(type);

            var trait = AbcTrait.CreateSlot(typeName, traitName);

            AddTrait(trait, isStatic);

            return(trait);
        }