本文整理汇总了C#中PEAPI类的典型用法代码示例。如果您正苦于以下问题:C# PEAPI类的具体用法?C# PEAPI怎么用?C# PEAPI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PEAPI类属于命名空间,在下文中一共展示了PEAPI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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"));
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}