本文整理汇总了C#中PEAPI类的典型用法代码示例。如果您正苦于以下问题:C# PEAPI类的具体用法?C# PEAPI怎么用?C# PEAPI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PEAPI类属于命名空间,在下文中一共展示了PEAPI类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: 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
示例2: PrimitiveTypeRef
public PrimitiveTypeRef (PEAPI.PrimitiveType type, string full_name, ArrayList conv_list, string sig_mod)
: base (full_name, conv_list, sig_mod)
{
this.type = type;
if (SigMod == null)
SigMod = String.Empty;
}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:PrimitiveTypeRef.cs
示例3: 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
示例4: AsMethodDef
private PEAPI.MethodDef AsMethodDef (PEAPI.Method method, string type)
{
PEAPI.MethodDef methoddef = method as PEAPI.MethodDef;
if (methoddef == null)
Report.Error (type + " method of property " + name + " not found");
return methoddef;
}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:PropertyDef.cs
示例5: 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
示例6: GenericParamRef
public GenericParamRef (PEAPI.GenParam gen_param, string full_name, ArrayList conv_list)
: base (full_name, false, conv_list, "")
{
this.type = gen_param;
this.param = gen_param;
is_added = false;
}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:GenericParamRef.cs
示例7: ParamDef
public ParamDef (PEAPI.ParamAttr attr, string name,
BaseTypeRef typeref) {
this.attr = attr;
this.name = name;
this.typeref = typeref;
is_defined = false;
defval = null;
}
开发者ID:nobled,项目名称:mono,代码行数:8,代码来源:ParamDef.cs
示例8: PeapiTypeRef
public PeapiTypeRef (PEAPI.Type peapi_type)
{
this.peapi_type = peapi_type;
is_pinned = false;
is_array = false;
is_ref = false;
use_type_spec = false;
}
开发者ID:psni,项目名称:mono,代码行数:8,代码来源:PeapiTypeRef.cs
示例9: CalliInstr
public CalliInstr (PEAPI.CallConv call_conv, BaseTypeRef ret_type,
BaseTypeRef[] param, Location loc)
: base (loc)
{
this.call_conv = call_conv;
this.ret_type = ret_type;
this.param = param;
}
开发者ID:nobled,项目名称:mono,代码行数:8,代码来源:CalliInstr.cs
示例10: 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
示例11: CreateMethodRef
protected override BaseMethodRef CreateMethodRef (BaseTypeRef ret_type,
PEAPI.CallConv call_conv, string name, BaseTypeRef[] param, int gen_param_count)
{
if (SigMod == null | SigMod == "")
return new MethodRef (this, call_conv, ret_type, name, param, gen_param_count);
else
return new TypeSpecMethodRef (this, call_conv, ret_type, name, param, gen_param_count);
}
开发者ID:nobled,项目名称:mono,代码行数:8,代码来源:TypeRef.cs
示例12: 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
示例13: MethodInstr
public MethodInstr (PEAPI.MethodOp op, BaseMethodRef operand, Location loc)
: base (loc)
{
this.op = op;
this.operand = operand;
if (op == PEAPI.MethodOp.newobj || op == PEAPI.MethodOp.callvirt)
operand.CallConv |= PEAPI.CallConv.Instance;
}
开发者ID:nobled,项目名称:mono,代码行数:9,代码来源:MethodInstr.cs
示例14: Resolve
public void Resolve (CodeGen code_gen, PEAPI.Module module)
{
this.module = module;
if (customattr_list == null)
return;
foreach (CustomAttr customattr in customattr_list)
customattr.AddTo (code_gen, module);
}
开发者ID:nobled,项目名称:mono,代码行数:10,代码来源:Module.cs
示例15: AddPermission
public void AddPermission (PEAPI.SecurityAction sec_action, IPermission perm)
{
SSPermissionSet ps = (SSPermissionSet) permissionset_table [sec_action];
if (ps == null) {
ps = new SSPermissionSet (PermissionState.None);
permissionset_table [sec_action] = ps;
}
ps.AddPermission (perm);
}
开发者ID:Profit0004,项目名称:mono,代码行数:10,代码来源:DeclSecurity.cs
示例16: MethodPointerTypeRef
public MethodPointerTypeRef (PEAPI.CallConv callconv, BaseTypeRef ret, ArrayList param_list, ArrayList conv_list, string sig_mod)
: base (String.Empty, conv_list, sig_mod)
{
this.callconv = callconv;
this.ret = ret;
this.param_list = param_list;
// We just need these to not break the interface
full_name = BuildTypeName ();
//sig_mod = String.Empty;
}
开发者ID:nobled,项目名称:mono,代码行数:11,代码来源:MethodPointerTypeRef.cs
示例17: AddPermissionSet
public void AddPermissionSet (PEAPI.SecurityAction sec_action, SSPermissionSet perm_set)
{
SSPermissionSet ps = (SSPermissionSet) permissionset_table [sec_action];
if (ps == null) {
permissionset_table [sec_action] = perm_set;
return;
}
foreach (IPermission iper in perm_set)
ps.AddPermission (iper);
}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:DeclSecurity.cs
示例18: Emit
public override void Emit (CodeGen code_gen, MethodDef meth,
PEAPI.CILInstructions cil)
{
PEAPI.CILLabel from = block.GetFromLabel (code_gen, meth);
PEAPI.CILLabel to = block.GetToLabel (code_gen, meth);
PEAPI.TryBlock try_block = new PEAPI.TryBlock (from, to);
foreach (ISehClause clause in clause_list)
try_block.AddHandler (clause.Resolve (code_gen, meth));
cil.AddTryBlock (try_block);
}
开发者ID:nobled,项目名称:mono,代码行数:12,代码来源:TryBlock.cs
示例19: GenericParameter
public GenericParameter (string id, PEAPI.GenericParamAttributes attr, ArrayList constraints)
{
this.id = id;
this.attr = attr;
num = -1;
constraintsList = null;
customattrList = null;
if (constraints != null)
foreach (BaseTypeRef typeref in constraints)
AddConstraint (typeref);
}
开发者ID:nobled,项目名称:mono,代码行数:12,代码来源:GenericParameters.cs
示例20: BaseMethodRef
public BaseMethodRef (BaseTypeRef owner, PEAPI.CallConv call_conv,
BaseTypeRef ret_type, string name, BaseTypeRef[] param, int gen_param_count)
{
this.owner = owner;
this.call_conv = call_conv;
this.ret_type = ret_type;
this.name = name;
this.param = param;
this.gen_param_count = gen_param_count;
if (gen_param_count > 0)
CallConv |= PEAPI.CallConv.Generic;
is_resolved = false;
}
开发者ID:nobled,项目名称:mono,代码行数:13,代码来源:BaseMethodRef.cs
注:本文中的PEAPI类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论