ToArray() public method

public ToArray ( ) : Microsoft.CSharp.RuntimeBinder.Semantics.CType[]
return Microsoft.CSharp.RuntimeBinder.Semantics.CType[]
示例#1
0
        // Initializes a substitution context. Returns false iff no substitutions will ever be performed.
        private void Init(TypeArray typeArgsCls, TypeArray typeArgsMeth, SubstTypeFlags grfst)
        {
            if (typeArgsCls != null)
            {
#if DEBUG
                typeArgsCls.AssertValid();
#endif
                ctypeCls   = typeArgsCls.size;
                prgtypeCls = typeArgsCls.ToArray();
            }
            else
            {
                ctypeCls   = 0;
                prgtypeCls = null;
            }

            if (typeArgsMeth != null)
            {
#if DEBUG
                typeArgsMeth.AssertValid();
#endif

                ctypeMeth   = typeArgsMeth.size;
                prgtypeMeth = typeArgsMeth.ToArray();
            }
            else
            {
                ctypeMeth   = 0;
                prgtypeMeth = null;
            }

            this.grfst = grfst;
        }
示例#2
0
 public TypeArray AllocParams(int ctype, TypeArray array, int offset)
 {
     CType[] types    = array.ToArray();
     CType[] newTypes = new CType[ctype];
     Array.ConstrainedCopy(types, offset, newTypes, 0, ctype);
     return(AllocParams(newTypes));
 }
示例#3
0
        // Initializes a substitution context. Returns false iff no substitutions will ever be performed.
        public void Init(TypeArray typeArgsCls, TypeArray typeArgsMeth, SubstTypeFlags grfst)
        {
            if (typeArgsCls != null)
            {
#if DEBUG
                typeArgsCls.AssertValid();
#endif
                ctypeCls = typeArgsCls.size;
                prgtypeCls = typeArgsCls.ToArray();
            }
            else
            {
                ctypeCls = 0;
                prgtypeCls = null;
            }

            if (typeArgsMeth != null)
            {
#if DEBUG
                typeArgsMeth.AssertValid();
#endif

                ctypeMeth = typeArgsMeth.size;
                prgtypeMeth = typeArgsMeth.ToArray();
            }
            else
            {
                ctypeMeth = 0;
                prgtypeMeth = null;
            }

            this.grfst = grfst;
        }
示例#4
0
 public static IEnumerable <AggregateType> AllConstraintInterfaces(this TypeArray constraints)
 {
     Debug.Assert(constraints != null);
     foreach (AggregateType c in constraints.ToArray())
     {
         foreach (AggregateType t in c.InterfaceAndBases())
         {
             yield return(t);
         }
     }
 }
示例#5
0
        // TODO: define this method
        public TypeArray AllocParams(int ctype, TypeArray array, int offset)
        {
            CType[] types    = array.ToArray();
            CType[] newTypes = new CType[ctype];
#if SILVERLIGHT
            Array.Copy(types, offset, newTypes, 0, ctype);
#else
            Array.ConstrainedCopy(types, offset, newTypes, 0, ctype);
#endif
            return(AllocParams(newTypes));
        }
示例#6
0
 public TypeArray ConcatParams(TypeArray pta1, TypeArray pta2)
 {
     return(ConcatParams(pta1.ToArray(), pta2.ToArray()));
 }