当前位置: 首页>>代码示例>>C#>>正文


C# ArgBuilder类代码示例

本文整理汇总了C#中ArgBuilder的典型用法代码示例。如果您正苦于以下问题:C# ArgBuilder类的具体用法?C# ArgBuilder怎么用?C# ArgBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ArgBuilder类属于命名空间,在下文中一共展示了ArgBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MapParameters

        internal void MapParameters(bool reduceByRef) {
            if (reduceByRef) {
                _returnArgs = new List<int>();
                if (CompilerHelpers.GetReturnType(_method) != typeof(void)) {
                    _returnArgs.Add(-1);
                }
            }

            BitArray specialParameters = _resolver.MapSpecialParameters(this);

            if (_instanceBuilder == null) {
                _instanceBuilder = new NullArgBuilder();
            }

            for (int infoIndex = 0; infoIndex < _parameterInfos.Length; infoIndex++) {
                if (!IsSpecialParameter(specialParameters, infoIndex)) {
                    if (reduceByRef) {
                        MapParameterReduceByRef(_parameterInfos[infoIndex]);
                    } else {
                        MapParameter(_parameterInfos[infoIndex]);
                    }
                }
            }

            _returnBuilder = MakeReturnBuilder(specialParameters);
        }
开发者ID:jcteague,项目名称:ironruby,代码行数:26,代码来源:ParameterMapping.cs

示例2: KeywordArgBuilder

        public KeywordArgBuilder(ArgBuilder builder, int kwArgCount, int kwArgIndex) 
            : base(builder.ParameterInfo) {

            Debug.Assert(BuilderExpectsSingleParameter(builder));
            _builder = builder;

            Debug.Assert(kwArgIndex < kwArgCount);
            _kwArgCount = kwArgCount;
            _kwArgIndex = kwArgIndex;
        }
开发者ID:tnachen,项目名称:ironruby,代码行数:10,代码来源:KeywordArgBuilder.cs

示例3: MethodTarget

        internal MethodTarget(MethodBinder binder, MethodBase method, int parameterCount, ArgBuilder instanceBuilder, IList<ArgBuilder> argBuilders, ReturnBuilder returnBuilder) {
            this._binder = binder;
            this._method = method;
            this._parameterCount = parameterCount;
            this._instanceBuilder = instanceBuilder;
            this._argBuilders = argBuilders;
            this._returnBuilder = returnBuilder;

            //argBuilders.TrimExcess();
        }
开发者ID:octavioh,项目名称:ironruby,代码行数:10,代码来源:MethodTarget.cs

示例4: MethodCandidate

        internal MethodCandidate(OverloadResolver resolver, MethodBase method, List<ParameterWrapper> parameters, ParameterWrapper paramsDict,
            ReturnBuilder returnBuilder, ArgBuilder instanceBuilder, IList<ArgBuilder> argBuilders) {

            Assert.NotNull(resolver, method, instanceBuilder, returnBuilder);
            Assert.NotNullItems(parameters);
            Assert.NotNullItems(argBuilders);

            _resolver = resolver;
            _method = method;
            _instanceBuilder = instanceBuilder;
            _argBuilders = argBuilders;
            _returnBuilder = returnBuilder;
            _parameters = parameters;
            _paramsDict = paramsDict;

            _paramsArrayIndex = ParameterWrapper.IndexOfParamsArray(parameters);

            parameters.TrimExcess();
        }
开发者ID:jcteague,项目名称:ironruby,代码行数:19,代码来源:MethodCandidate.cs

示例5: Starg

        /// <summary>
        /// Starg
        /// </summary>
        /// <param name="arg"></param>
        public void Starg(ArgBuilder arg)
        {
            Check.Require(arg, "arg");

            this.Starg(arg.Index);
        }
开发者ID:Oman,项目名称:Maleos,代码行数:10,代码来源:CodeGenerator.cs

示例6: LdargAddress

        /// <summary>
        /// LdargAddress ���ز�����ַ��ILû�����ָ������ݲ��������ͷֱ���ò�ͬ��ILָ�
        /// ������Ϊֵ����ʱ��ͨ������Ldargaָ����ز�����ַ
        /// ���β�Ϊֵ����ʱ��ֱ�ӵ���Ldarg���ز���
        /// </summary>
        /// <param name="argBuilder"></param>
        public void LdargAddress(ArgBuilder argBuilder)
        {
            Check.Require(argBuilder, "argBuilder");

            if (argBuilder.ArgType.IsValueType)
            {
                this.Ldarga(argBuilder);
            }
            else
            {
                this.Ldarg(argBuilder);
            }
        }
开发者ID:Oman,项目名称:Maleos,代码行数:19,代码来源:CodeGenerator.cs

示例7: Ldarga

        /// <summary>
        /// Ldarga ���� Ldarga(int) ����
        /// </summary>
        /// <param name="argBuilder"></param>
        public void Ldarga(ArgBuilder argBuilder)
        {
            Check.Require(argBuilder, "argBuilder");

            this.Ldarga(argBuilder.Index);
        }
开发者ID:Oman,项目名称:Maleos,代码行数:10,代码来源:CodeGenerator.cs

示例8: InitArgs

            void InitArgs(Type objType)
            {
                xmlWriterArg = ilg.GetArg(0);
                contextArg = ilg.GetArg(2);
                dataContractArg = ilg.GetArg(3);

                objectLocal = ilg.DeclareLocal(objType, "objSerialized");
                ArgBuilder objectArg = ilg.GetArg(1);
                ilg.Load(objectArg);

                // Copy the data from the DataTimeOffset object passed in to the DateTimeOffsetAdapter.
                // DateTimeOffsetAdapter is used here for serialization purposes to bypass the ISerializable implementation
                // on DateTimeOffset; which does not work in partial trust.

                if (objType == Globals.TypeOfDateTimeOffsetAdapter)
                {
                    ilg.ConvertValue(objectArg.ArgType, Globals.TypeOfDateTimeOffset);
                    ilg.Call(XmlFormatGeneratorStatics.GetDateTimeOffsetAdapterMethod);
                }
                else
                {
                    ilg.ConvertValue(objectArg.ArgType, objType);
                }
                ilg.Stloc(objectLocal);
            }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:25,代码来源:XmlFormatWriterGenerator.cs

示例9: IsStartElement

 void IsStartElement(ArgBuilder nameArg, ArgBuilder nsArg)
 {
     ilg.Call(xmlReaderArg, XmlFormatGeneratorStatics.IsStartElementMethod2, nameArg, nsArg);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:4,代码来源:XmlFormatReaderGenerator.cs

示例10: Ldarg

 internal void Ldarg(ArgBuilder arg) {
     Ldarg(arg.Index);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:3,代码来源:CodeGenerator.cs

示例11: InitArgs

 private void InitArgs(Type objType)
 {
     this.xmlWriterArg = this.ilg.GetArg(0);
     this.contextArg = this.ilg.GetArg(2);
     this.dataContractArg = this.ilg.GetArg(3);
     this.objectLocal = this.ilg.DeclareLocal(objType, "objSerialized");
     ArgBuilder arg = this.ilg.GetArg(1);
     this.ilg.Load(arg);
     if (objType == Globals.TypeOfDateTimeOffsetAdapter)
     {
         this.ilg.ConvertValue(arg.ArgType, Globals.TypeOfDateTimeOffset);
         this.ilg.Call(XmlFormatGeneratorStatics.GetDateTimeOffsetAdapterMethod);
     }
     else
     {
         this.ilg.ConvertValue(arg.ArgType, objType);
     }
     this.ilg.Stloc(this.objectLocal);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:19,代码来源:XmlFormatWriterGenerator.cs

示例12: InitArgs

            private void InitArgs(Type objType)
            {
                _xmlWriterArg = _ilg.GetArg(0);
                _contextArg = _ilg.GetArg(2);
                _dataContractArg = _ilg.GetArg(3);

                _objectLocal = _ilg.DeclareLocal(objType, "objSerialized");
                ArgBuilder objectArg = _ilg.GetArg(1);
                _ilg.Load(objectArg);

                // Copy the data from the DataTimeOffset object passed in to the DateTimeOffsetAdapter.
                // DateTimeOffsetAdapter is used here for serialization purposes to bypass the ISerializable implementation
                // on DateTimeOffset; which does not work in partial trust.

                if (objType == Globals.TypeOfDateTimeOffsetAdapter)
                {
                    _ilg.ConvertValue(objectArg.ArgType, Globals.TypeOfDateTimeOffset);
                    _ilg.Call(XmlFormatGeneratorStatics.GetDateTimeOffsetAdapterMethod);
                }
                //Copy the KeyValuePair<K,T> to a KeyValuePairAdapter<K,T>. 
                else if (objType.GetTypeInfo().IsGenericType && objType.GetGenericTypeDefinition() == Globals.TypeOfKeyValuePairAdapter)
                {
                    ClassDataContract dc = (ClassDataContract)DataContract.GetDataContract(objType);
                    _ilg.ConvertValue(objectArg.ArgType, Globals.TypeOfKeyValuePair.MakeGenericType(dc.KeyValuePairGenericArguments));
                    _ilg.New(dc.KeyValuePairAdapterConstructorInfo);
                }
                else
                {
                    _ilg.ConvertValue(objectArg.ArgType, objType);
                }
                _ilg.Stloc(_objectLocal);
            }
开发者ID:SGuyGe,项目名称:corefx,代码行数:32,代码来源:XmlFormatWriterGenerator.cs

示例13: BuilderExpectsSingleParameter

 /// <summary>
 /// The underlying builder should expect a single parameter as KeywordArgBuilder is responsible
 /// for calculating the correct parameter to use
 /// </summary>
 /// <param name="builder"></param>
 internal static bool BuilderExpectsSingleParameter(ArgBuilder builder) {
     return (((SimpleArgBuilder)builder).Index == 0);
 }
开发者ID:tnachen,项目名称:ironruby,代码行数:8,代码来源:KeywordArgBuilder.cs

示例14: VariantBuilder

 internal VariantBuilder(VarEnum targetComType, ArgBuilder builder) {
     _targetComType = targetComType;
     _argBuilder = builder;
 }
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:4,代码来源:VariantBuilder.cs

示例15: Ldarga

 internal void Ldarga(ArgBuilder argBuilder) {
     Ldarga(argBuilder.Index);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:3,代码来源:CodeGenerator.cs


注:本文中的ArgBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。