예제 #1
0
        public override MarshalSpec CloneInto(IHasMarshalSpec container)
        {
            FixedArraySpec spec = new FixedArraySpec(container);

            spec.m_numElem  = m_numElem;
            spec.m_elemType = m_elemType;
            return(spec);
        }
예제 #2
0
 protected MarshalSpec BuildMarshalDesc(MarshalSig ms, IHasMarshalSpec container)
 {
     if (ms.Spec is MarshalSig.Array)
     {
         ArrayMarshalSpec amd = new ArrayMarshalSpec(container);
         MarshalSig.Array ar  = (MarshalSig.Array)ms.Spec;
         amd.ElemType = ar.ArrayElemType;
         amd.NumElem  = ar.NumElem;
         amd.ParamNum = ar.ParamNum;
         amd.ElemMult = ar.ElemMult;
         return(amd);
     }
     else if (ms.Spec is MarshalSig.CustomMarshaler)
     {
         CustomMarshalerSpec        cmd   = new CustomMarshalerSpec(container);
         MarshalSig.CustomMarshaler cmsig = (MarshalSig.CustomMarshaler)ms.Spec;
         cmd.Guid          = cmsig.Guid.Length > 0 ? new Guid(cmsig.Guid) : new Guid();
         cmd.UnmanagedType = cmsig.UnmanagedType;
         cmd.ManagedType   = cmsig.ManagedType;
         cmd.Cookie        = cmsig.Cookie;
         return(cmd);
     }
     else if (ms.Spec is MarshalSig.FixedArray)
     {
         FixedArraySpec        fad   = new FixedArraySpec(container);
         MarshalSig.FixedArray fasig = (MarshalSig.FixedArray)ms.Spec;
         fad.ElemType = fasig.ArrayElemType;
         fad.NumElem  = fasig.NumElem;
         return(fad);
     }
     else if (ms.Spec is MarshalSig.FixedSysString)
     {
         FixedSysStringSpec fssc = new FixedSysStringSpec(container);
         fssc.Size = ((MarshalSig.FixedSysString)ms.Spec).Size;
         return(fssc);
     }
     else if (ms.Spec is MarshalSig.SafeArray)
     {
         SafeArraySpec sad = new SafeArraySpec(container);
         sad.ElemType = ((MarshalSig.SafeArray)ms.Spec).ArrayElemType;
         return(sad);
     }
     else
     {
         return(new MarshalSpec(ms.NativeInstrinsic, container));
     }
 }
예제 #3
0
 protected MarshalSpec BuildMarshalDesc(MarshalSig ms, IHasMarshalSpec container)
 {
     if (ms.Spec is MarshalSig.Array) {
         ArrayMarshalSpec amd = new ArrayMarshalSpec (container);
         MarshalSig.Array ar = (MarshalSig.Array) ms.Spec;
         amd.ElemType = ar.ArrayElemType;
         amd.NumElem = ar.NumElem;
         amd.ParamNum = ar.ParamNum;
         amd.ElemMult = ar.ElemMult;
         return amd;
     } else if (ms.Spec is MarshalSig.CustomMarshaler) {
         CustomMarshalerSpec cmd = new CustomMarshalerSpec (container);
         MarshalSig.CustomMarshaler cmsig = (MarshalSig.CustomMarshaler) ms.Spec;
         cmd.Guid = cmsig.Guid.Length > 0 ? new Guid (cmsig.Guid) : new Guid ();
         cmd.UnmanagedType = cmsig.UnmanagedType;
         cmd.ManagedType = cmsig.ManagedType;
         cmd.Cookie = cmsig.Cookie;
         return cmd;
     } else if (ms.Spec is MarshalSig.FixedArray) {
         FixedArraySpec fad = new FixedArraySpec (container);
         MarshalSig.FixedArray fasig = (MarshalSig.FixedArray) ms.Spec;
         fad.ElemType = fasig.ArrayElemType;
         fad.NumElem = fasig.NumElem;
         return fad;
     } else if (ms.Spec is MarshalSig.FixedSysString) {
         FixedSysStringSpec fssc = new FixedSysStringSpec (container);
         fssc.Size = ((MarshalSig.FixedSysString) ms.Spec).Size;
         return fssc;
     } else if (ms.Spec is MarshalSig.SafeArray) {
         SafeArraySpec sad = new SafeArraySpec (container);
         sad.ElemType = ((MarshalSig.SafeArray) ms.Spec).ArrayElemType;
         return sad;
     } else {
         return new MarshalSpec (ms.NativeInstrinsic, container);
     }
 }
예제 #4
0
파일: MarshalSpec.cs 프로젝트: nobled/mono
		public override MarshalSpec CloneInto (IHasMarshalSpec container)
		{
			FixedArraySpec spec = new FixedArraySpec (container);
			spec.m_numElem = m_numElem;
			spec.m_elemType = m_elemType;
			return spec;
		}