Ejemplo n.º 1
0
        public RemoteArgument(System.Array array, bool isByRef)
        {
            if (array == null)
            {
                throw new ArgumentNullException("array");
            }

            //this handles multi-dimensional intrinsic arrays, too.
            //Jagged arrays are handled recursively as arrays of arrays
            //we can't just ask the type if it IsPrimitive because string says "false"
            if (Type.GetTypeCode(array.GetType().GetElementType()) == TypeCode.Object)
            {
                throw new ArgumentException(null, "array");
            }

            this._value = array;
            this.remoteArgKind = RemoteArgumentKind.IntrinsicArray;
            //for IntrinsicArray this holds the element type code
            this.intrinsicTypeCode = Type.GetTypeCode(array.GetType().GetElementType());
            this.isByRef = isByRef;
        }
Ejemplo n.º 2
0
 public RemoteArgument(System.UInt64 value, bool isByRef)
 {
     this._value = value;
     this.remoteArgKind = RemoteArgumentKind.Intrinsic;
     this.intrinsicTypeCode = TypeCode.UInt64;
     this.isByRef = isByRef;
 }
Ejemplo n.º 3
0
 public RemoteArgument(System.UInt32 value)
 {
     this._value = value;
     this.remoteArgKind = RemoteArgumentKind.Intrinsic;
     this.intrinsicTypeCode = TypeCode.UInt32;
     this.isByRef = false;
 }
Ejemplo n.º 4
0
        public RemoteArgument(RemoteArgumentKind remoteArgKind, TypeCode typeCode, bool isByRef)
        {
            this._value = null;
            this.isByRef = isByRef;
            this.remoteArgKind = remoteArgKind;
            switch (remoteArgKind)
            {
                case RemoteArgumentKind.Missing:
                    if (typeCode != TypeCode.Empty)
                        throw new ArgumentException(null, "typeCode");
                    this.intrinsicTypeCode = typeCode;
                    break;
                case RemoteArgumentKind.Intrinsic:
                case RemoteArgumentKind.IntrinsicArray:
                    if (typeCode == TypeCode.Object ||
                        typeCode == TypeCode.Empty)
                        throw new ArgumentException(null, "typeCode");
                    this.intrinsicTypeCode = typeCode;
                    break;

                case RemoteArgumentKind.Contract:
                    if (typeCode != TypeCode.Object)
                        throw new ArgumentException(null, "typeCode");
                    this.intrinsicTypeCode = typeCode;
                    break;

                default:
                    throw new InvalidOperationException();
            }
        }
Ejemplo n.º 5
0
 //isByRef == true means "out". Must be true if Kind == Contract
 public RemoteArgument(RemoteArgumentKind remoteArgKind, TypeCode typeCode) : this(remoteArgKind, typeCode, false)
 {
 }
Ejemplo n.º 6
0
 public RemoteArgument(IContract value, bool isByRef)
 {
     this._value = value;
     this.remoteArgKind = RemoteArgumentKind.Contract;
     this.intrinsicTypeCode = TypeCode.Object;
     this.isByRef = isByRef;
 }