本文整理匯總了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;
}