本文整理汇总了C#中Mono.Cecil.TypeDefinition.IsNSObject方法的典型用法代码示例。如果您正苦于以下问题:C# TypeDefinition.IsNSObject方法的具体用法?C# TypeDefinition.IsNSObject怎么用?C# TypeDefinition.IsNSObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Cecil.TypeDefinition
的用法示例。
在下文中一共展示了TypeDefinition.IsNSObject方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessType
public override void ProcessType (TypeDefinition type)
{
if (!type.IsNSObject () || !type.IsNativeObject ())
return;
base.ProcessType (type);
}
示例2: ProcessType
public override void ProcessType(TypeDefinition type)
{
if (ProductAssembly == null)
ProductAssembly = (Profile.Current as BaseProfile).ProductAssembly;
bool nsobject = type.IsNSObject ();
if (!nsobject && !type.IsNativeObject ())
return;
if (!IsProductType (type)) {
// we need to annotate the parent type(s) of a nested type
// otherwise the sweeper will not keep the parents (nor the childs)
if (type.IsNested) {
var parent = type.DeclaringType;
while (parent != null) {
Annotations.Mark (parent);
parent = parent.DeclaringType;
}
}
Annotations.Mark (type);
Annotations.SetPreserve (type, TypePreserve.All);
} else {
PreserveIntPtrConstructor (type);
if (nsobject)
PreserveExportedMethods (type);
}
}
示例3: ProcessType
public override void ProcessType(TypeDefinition type)
{
// if 'type' inherits from NSObject inside an assembly that has [GeneratedCode]
// or for static types used for optional members (using extensions methods), they can be optimized too
bool extensions = type.IsSealed && type.IsAbstract && type.Name.EndsWith ("_Extensions", StringComparison.Ordinal);
if (!HasGeneratedCode && (type.IsNSObject () || !extensions))
return;
if (type.HasMethods)
ProcessMethods (type.Methods, extensions);
}
示例4: ProcessType
void ProcessType(TypeDefinition type)
{
if (type.IsNSObject ()) {
ProcessNSObject (type);
} else if (type.HasNestedTypes) {
foreach (var nested in type.NestedTypes)
ProcessType (nested);
}
}
示例5: IsNSObject
// called once for each 'type' so it's a nice place to cache the result
// and ensure later steps re-use the same, pre-computed, result
static bool IsNSObject(TypeDefinition type)
{
if (!type.IsNSObject ())
return false;
cached_isnsobject.Add (type);
return true;
}