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

C# ILASM.CodeGen类代码示例

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

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



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

示例1: Resolve

                public override void Resolve (CodeGen code_gen)
                {
                        if (is_resolved)
                                return;

			owner.Resolve (code_gen);

                        TypeDef owner_def = code_gen.TypeManager[owner.FullName];
			if (owner_def == null)
				Report.Error ("Reference to undefined class '" + owner.FullName + "'");

                        if ((call_conv & PEAPI.CallConv.Vararg) == 0) {
                                peapi_method = owner_def.ResolveMethod (ret_type, call_conv, name, 
                                        param, gen_param_count, code_gen);
                        } else {
                                ArrayList opt_list = new ArrayList ();
                                bool in_opt = false;
                                foreach (BaseTypeRef type in param) {
                                        if (type is SentinelTypeRef) {
                                                in_opt = true;
                                        } else if (in_opt) {
                                                type.Resolve (code_gen);
                                                opt_list.Add (type.PeapiType);
                                        }
                                }
                                peapi_method = owner_def.ResolveVarargMethod (
                                                ret_type, call_conv, name, param, gen_param_count,
                                                (PEAPI.Type[]) opt_list.ToArray (typeof (PEAPI.Type)),
                                                code_gen);
                        }

                        is_resolved = true;

                }
开发者ID:Profit0004,项目名称:mono,代码行数:34,代码来源:MethodRef.cs


示例2: Resolve

                public PEAPI.Permission Resolve (CodeGen code_gen)
                {
                        string fname;

                        type_ref.Resolve (code_gen);

                        if (type_ref is ExternTypeRef) {
                                ExternAssembly ea = ((ExternTypeRef) type_ref).ExternRef as ExternAssembly;
                                if (ea == null)
                                        //FIXME: module.. ?
                                        throw new NotImplementedException ();

                                string name;
                                ExternTypeRef etr = type_ref as ExternTypeRef;
                                if (etr != null)
                                        name = etr.Name;
                                else
                                        name = type_ref.FullName;

                                fname = String.Format ("{0}, {1}", name, ea.AssemblyName.FullName);
                        } else {
                                fname = type_ref.FullName;
                        }

                        perm = new PEAPI.Permission (type_ref.PeapiType, fname);
                                        
                        foreach (PermissionMember member in members)
                                perm.AddMember (member.Resolve (code_gen));

                        return perm;
                }
开发者ID:nobled,项目名称:mono,代码行数:31,代码来源:Permission.cs


示例3: Define

                public void Define (CodeGen code_gen, PEAPI.ClassDef classdef)
                {
                        if (!is_resolved)
                                Resolve (code_gen, classdef);

                        if (addon != null) {
                                addon.Resolve (code_gen);
                                event_def.AddAddon (AsMethodDef (addon.PeapiMethod, "addon"));
                        }

                        if (fire != null) {
                                fire.Resolve (code_gen);
                                event_def.AddFire (AsMethodDef (fire.PeapiMethod, "fire"));
                        }

                        if (other_list != null) {
				foreach (MethodRef otherm in other_list) {
	                                otherm.Resolve (code_gen);
        	                        event_def.AddOther (AsMethodDef (otherm.PeapiMethod, "other"));
				}
                        }

                        if (removeon != null) {
                                removeon.Resolve (code_gen);
                                event_def.AddRemoveOn (AsMethodDef (removeon.PeapiMethod, "removeon"));
                        }
                }
开发者ID:nobled,项目名称:mono,代码行数:27,代码来源:EventDef.cs


示例4: AddTo

                public void AddTo (CodeGen code_gen, PEAPI.MetaDataElement elem)
                {
                        System.Text.UnicodeEncoding ue = new System.Text.UnicodeEncoding ();
                        foreach (DictionaryEntry entry in permissionset_table) {
                                PEAPI.SecurityAction sec_action = (PEAPI.SecurityAction) entry.Key;
                                SSPermissionSet ps = (SSPermissionSet) entry.Value;

                                code_gen.PEFile.AddDeclSecurity (sec_action,
                                        ue.GetBytes (ps.ToXml ().ToString ()), 
                                         elem);
                        }

                        if (permissionset20_table == null)
                                return;

                        foreach (DictionaryEntry entry in permissionset20_table) {
                                PEAPI.SecurityAction sec_action = (PEAPI.SecurityAction) entry.Key;
                                MIPermissionSet ps = (MIPermissionSet) entry.Value;

                                code_gen.PEFile.AddDeclSecurity (sec_action,
                                        ps.Resolve (code_gen), 
                                        elem);
                        }

                }
开发者ID:Profit0004,项目名称:mono,代码行数:25,代码来源:DeclSecurity.cs


示例5: Resolve

                public override void Resolve (CodeGen code_gen)
                {
			if (is_resolved)
				return;

                        if ((call_conv & PEAPI.CallConv.Vararg) == 0) {
                                string sig = MethodDef.CreateSignature (ret_type, call_conv, name, param, gen_param_count, false);
                                peapi_method = code_gen.ResolveMethod (sig);
                        } else {
                                ArrayList opt_list = new ArrayList ();
                                bool in_opt = false;
                                foreach (BaseTypeRef type in param) {
                                        if (type is SentinelTypeRef) {
                                                in_opt = true;
                                        } else if (in_opt) {
                                                type.Resolve (code_gen);
                                                opt_list.Add (type.PeapiType);
                                        }
                                }

                                string sig_only_required_params = MethodDef.CreateSignature (ret_type, call_conv, name, param, gen_param_count, false);
                                string sig_with_optional_params = MethodDef.CreateSignature (ret_type, call_conv, name, param, gen_param_count, true);
                                peapi_method = code_gen.ResolveVarargMethod (sig_only_required_params, sig_with_optional_params, code_gen,
                                                (PEAPI.Type[]) opt_list.ToArray (typeof (PEAPI.Type)));
                        }

                        peapi_method.AddCallConv (call_conv);
			
			is_resolved = true;
                }
开发者ID:nobled,项目名称:mono,代码行数:30,代码来源:GlobalMethodRef.cs


示例6: Resolve

                public PEAPI.Property Resolve (CodeGen code_gen, PEAPI.ClassDef classdef)
                {
                        if (is_resolved)
                                return prop_def;

                        PEAPI.Type[] type_list = new PEAPI.Type[arg_list.Count];

                        for (int i=0; i<type_list.Length; i++) {
                                BaseTypeRef arg_type = (BaseTypeRef) arg_list[i];
                                arg_type.Resolve (code_gen);
                                type_list[i] = arg_type.PeapiType;
                        }

                        type.Resolve (code_gen);
                        prop_def = classdef.AddProperty (name, type.PeapiType, type_list);

                        if ((attr & FeatureAttr.Rtspecialname) != 0)
                                prop_def.SetRTSpecialName ();

                        if ((attr & FeatureAttr.Specialname) != 0)
                                prop_def.SetSpecialName ();

                        prop_def.SetInstance ((attr & FeatureAttr.Instance) != 0);

                        if (customattr_list != null)
                                foreach (CustomAttr customattr in customattr_list)
                                        customattr.AddTo (code_gen, prop_def);


                        is_resolved = true;

                        return prop_def;
                }
开发者ID:nobled,项目名称:mono,代码行数:33,代码来源:PropertyDef.cs


示例7: Resolve

                public override void Resolve (CodeGen code_gen)
                {
                        if (is_resolved)
                                return;

                        PEAPI.Type[] param_list = new PEAPI.Type[param.Length];
                        string write_name;

                        ret_type.Resolve (code_gen);

                        int count = 0;
                        foreach (BaseTypeRef typeref in param) {
                                typeref.Resolve (code_gen);
                                param_list[count++] = typeref.PeapiType;
                        }

                        if (name == "<init>")
                                write_name = ".ctor";
                        else
                                write_name = name;

                        owner.Resolve (code_gen);
                        peapi_method = code_gen.PEFile.AddMethodToTypeSpec (owner.PeapiType, write_name,
                                        ret_type.PeapiType, param_list, gen_param_count);

                        peapi_method.AddCallConv (call_conv);

                        is_resolved = true;
                }
开发者ID:nobled,项目名称:mono,代码行数:29,代码来源:TypeSpecMethodRef.cs


示例8: Resolve

                public PEAPI.PermissionMember Resolve (CodeGen code_gen)
                {
                        type_ref.Resolve (code_gen);

                        member = new PEAPI.PermissionMember (member_type, type_ref.PeapiType, name, value);

                        return member;
                }
开发者ID:nobled,项目名称:mono,代码行数:8,代码来源:PermissionMember.cs


示例9: Resolve

                public PEAPI.HandlerBlock Resolve (CodeGen code_gen, MethodDef method)
                {
                        PEAPI.CILLabel from = handler_block.GetFromLabel (code_gen, method);
                        PEAPI.CILLabel to = handler_block.GetToLabel (code_gen, method);
                        PEAPI.Fault fault = new PEAPI.Fault (from, to);

                        return fault;
                }
开发者ID:nobled,项目名称:mono,代码行数:8,代码来源:FaultBlock.cs


示例10: ResolveNoTypeSpec

 public override void ResolveNoTypeSpec (CodeGen code_gen)
 {
         if (is_resolved)
                 return;
         
         type = Modify (code_gen, type);
         is_resolved = true;
 }
开发者ID:nobled,项目名称:mono,代码行数:8,代码来源:GenericParamRef.cs


示例11: Resolve

                public PEAPI.HandlerBlock Resolve (CodeGen code_gen, MethodDef method)
                {
                        PEAPI.CILLabel from = handler_block.GetFromLabel (code_gen, method);
                        PEAPI.CILLabel to = handler_block.GetToLabel (code_gen, method);
                        PEAPI.Finally phinally = new PEAPI.Finally (from, to);

                        return phinally;
                }
开发者ID:nobled,项目名称:mono,代码行数:8,代码来源:FinallyBlock.cs


示例12: Resolve

                public PEAPI.PermissionSet Resolve (CodeGen code_gen)
                {
                       ps = new PEAPI.PermissionSet (sec_action); 
                       foreach (Permission perm in permissions)
                               ps.AddPermission (perm.Resolve (code_gen));

                       return ps;
                }
开发者ID:nobled,项目名称:mono,代码行数:8,代码来源:PermissionSet.cs


示例13: Emit

                public override void Emit (CodeGen code_gen, MethodDef meth,
					   PEAPI.CILInstructions cil)
                {
                        if (operand != null)
                                cil.ldstr (operand);
                        else
                                cil.ldstr (b_operand);
                }
开发者ID:nobled,项目名称:mono,代码行数:8,代码来源:LdstrInstr.cs


示例14: Resolve

                public PEAPI.HandlerBlock Resolve (CodeGen code_gen, MethodDef method)
                {
                        PEAPI.CILLabel label = this_block.GetFromLabel (code_gen, method);
                        PEAPI.CILLabel from = handler_block.GetFromLabel (code_gen, method);
                        PEAPI.CILLabel to = handler_block.GetToLabel (code_gen, method);
                        PEAPI.Filter filter = new PEAPI.Filter (label, from, to);

                        return filter;
                }
开发者ID:nobled,项目名称:mono,代码行数:9,代码来源:FilterBlock.cs


示例15: Resolve

                public void Resolve (CodeGen code_gen)
                {
			if (is_resolved)
				return;

                        peapi_field = code_gen.ResolveField (name, ret_type.FullName);

			is_resolved = true;
                }
开发者ID:nobled,项目名称:mono,代码行数:9,代码来源:GlobalFieldRef.cs


示例16: Resolve

		private void Resolve (CodeGen code_gen, PEAPI.GenericParameter gp)
		{
			ResolveConstraints (code_gen, gp);
			if (customattrList == null)
				return;

			foreach (CustomAttr customattr in customattrList)
				customattr.AddTo (code_gen, gp);
		}
开发者ID:nobled,项目名称:mono,代码行数:9,代码来源:GenericParameters.cs


示例17: Resolve

                public override void Resolve (CodeGen code_gen)
                {
                        ResolveNoTypeSpec (code_gen);
                        if (is_added)
                                return;

                        code_gen.PEFile.AddGenericClass ((PEAPI.GenericTypeInst) p_gen_inst);
                        is_added = true;
                }
开发者ID:mono,项目名称:mono,代码行数:9,代码来源:GenericTypeInst.cs


示例18: Resolve

                public PEAPI.GenericMethodSig Resolve (CodeGen code_gen)
                {
                        if (is_resolved)
                                return sig;

                        sig = new PEAPI.GenericMethodSig (gen_args.Resolve (code_gen));
                        is_resolved = true;

                        return sig;
                }
开发者ID:nobled,项目名称:mono,代码行数:10,代码来源:GenericMethodSig.cs


示例19: Resolve

                public override void Resolve (CodeGen code_gen)
                {
                        if (is_resolved)
                                return;

                        meth.Resolve (code_gen);
                        peapi_method = code_gen.PEFile.AddMethodSpec (meth.PeapiMethod, sig.Resolve (code_gen));

                        is_resolved = true;
                }
开发者ID:nobled,项目名称:mono,代码行数:10,代码来源:GenericMethodRef.cs


示例20: Resolve

                public void Resolve (CodeGen code_gen)
                {
			if (is_resolved)
				return;

                        TypeDef owner_def = code_gen.TypeManager[owner.FullName];
                        peapi_field = owner_def.ResolveField (name, ret_type, code_gen);

			is_resolved = true;
                }
开发者ID:nobled,项目名称:mono,代码行数:10,代码来源:FieldRef.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Math.BigInteger类代码示例发布时间:2022-05-26
下一篇:
C# Soft.SoftDebuggerStartInfo类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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