Пример #1
0
 public override void WriteTo(FlashWriter output)
 {
     output.WriteInt30(Traits.Count);
     for (int i = 0; i < Traits.Count; i++)
     {
         ASTrait trait = Traits[i];
         trait.WriteTo(output);
     }
 }
Пример #2
0
        protected void PopulateTraits(FlashReader input)
        {
            Traits.Capacity = input.ReadInt30();
            for (int i = 0; i < Traits.Capacity; i++)
            {
                var trait = new ASTrait(ABC, input);
                trait.IsStatic = IsStatic;

                if (trait.Kind == TraitKind.Method ||
                    trait.Kind == TraitKind.Getter ||
                    trait.Kind == TraitKind.Setter)
                {
                    trait.Method.Container = this;
                }

                Traits.Add(trait);
            }
        }
Пример #3
0
        public void AddMethod(ASMethod method, string qualifiedName)
        {
            var qname = new ASMultiname(ABC.Pool);

            qname.NameIndex      = ABC.Pool.AddConstant(qualifiedName);
            qname.Kind           = MultinameKind.QName;
            qname.NamespaceIndex = 1; // Public

            int methodIndex = ABC.AddMethod(method);
            int qnameIndex  = ABC.Pool.AddConstant(qname);

            var trait = new ASTrait(ABC);

            trait.Kind        = TraitKind.Method;
            trait.QNameIndex  = qnameIndex;
            trait.MethodIndex = methodIndex;

            method.Trait     = trait;
            method.Container = this;
            Traits.Add(trait);
        }