• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ArgBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: InitILGeneration

 void InitILGeneration(Type[] argTypes, string[] argNames, bool isStatic) {
     this.methodEndLabel = ilGen.DefineLabel();
     this.retLabel = ilGen.DefineLabel();
     this.blockStack = new Stack();
     this.whileStack = new Stack();
     this.currentScope = new LocalScope();
     this.freeLocals = new Dictionary<Tuple<Type, string>, Queue<LocalBuilder>>(); 
     this.argList = new Dictionary<string, ArgBuilder>();
     // this ptr is arg 0 for non static, assuming ref type (not value type) 
     if (!isStatic)
         argList.Add("this", new ArgBuilder("this", 0, this.typeBuilder.BaseType));
     for (int i = 0; i < argTypes.Length; i++) {
         ArgBuilder arg = new ArgBuilder(argNames[i], argList.Count, argTypes[i]);
         argList.Add(arg.Name, arg);
         this.methodBuilder.DefineParameter(arg.Index, ParameterAttributes.None, arg.Name);
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:17,代码来源:CodeGenerator.cs


示例17: LdargAddress

 internal void LdargAddress(ArgBuilder argBuilder) {
     if (argBuilder.ArgType.IsValueType)
         Ldarga(argBuilder);
     else
         Ldarg(argBuilder);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:6,代码来源:CodeGenerator.cs


示例18: LdargAddress

 internal void LdargAddress(ArgBuilder argBuilder)
 {
     if (argBuilder.ArgType.IsValueType)
     {
         this.Ldarga(argBuilder);
     }
     else
     {
         this.Ldarg(argBuilder);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:CodeGenerator.cs


示例19: Starg

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


示例20: LoadInputParametersIntoLocals

 void LoadInputParametersIntoLocals(ParameterInfo[] parameters, LocalBuilder[] parameterLocals, ArgBuilder inputParametersArg, out int inputParameterCount)
 {
     inputParameterCount = 0;
     for (int i = 0; i < parameterLocals.Length; i++)
     {
         if (ServiceReflector.FlowsIn(parameters[i]))
         {
             Type parameterType = parameterLocals[i].LocalType;
             ilg.LoadArrayElement(inputParametersArg, inputParameterCount);
             if (!parameterType.IsValueType)
             {
                 ilg.ConvertValue(TypeOfObject, parameterType);
                 ilg.Store(parameterLocals[i]);
             }
             else
             {
                 ilg.Dup();
                 ilg.If();
                 ilg.ConvertValue(TypeOfObject, parameterType);
                 ilg.Store(parameterLocals[i]);
                 ilg.Else();
                 ilg.Pop();
                 ilg.LoadZeroValueIntoLocal(parameterType, parameterLocals[i]);
                 ilg.EndIf();
             }
             inputParameterCount++;
         }
     }
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:29,代码来源:InvokerUtil.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Args类代码示例发布时间:2022-05-24
下一篇:
C# Arebis类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap