本文整理汇总了C#中Mono.Cecil.TypeDefinition.ExternallyVisible方法的典型用法代码示例。如果您正苦于以下问题:C# TypeDefinition.ExternallyVisible方法的具体用法?C# TypeDefinition.ExternallyVisible怎么用?C# TypeDefinition.ExternallyVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Cecil.TypeDefinition
的用法示例。
在下文中一共展示了TypeDefinition.ExternallyVisible方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoIsVisible
private bool DoIsVisible(TypeDefinition type)
{
bool visible = type.ExternallyVisible(Cache);
Log.DebugLine(this, "{0}.visible = {1}", type.Name, visible);
return visible;
}
示例2: VisitType
public void VisitType(TypeDefinition type)
{
if (type.ExternallyVisible(Cache))
{
Log.DebugLine(this, "-----------------------------------");
Log.DebugLine(this, "checking {0}", type.Name);
if (DoObsoleteTerm(type.Name))
{
Reporter.TypeFailed(type, CheckID, string.Empty);
}
}
}
示例3: VisitType
public void VisitType(TypeDefinition type)
{
DBC.Assert(m_state == State.Types, "state is {0}", m_state);
Log.DebugLine(this, "{0}", type.FullName);
if (!type.ExternallyVisible(Cache) && DoInstantiable(type) && DoValidType(type))
{
if (!type.IsCompilerGenerated())
{
var key = new AssemblyCache.TypeKey(type);
DBC.Assert(m_keys.IndexOf(key) < 0, "{0} is already in types", type.FullName);
Log.DebugLine(this, "adding {0}", type.FullName);
m_keys.Add(key);
}
}
}
示例4: VisitType
public void VisitType(TypeDefinition type)
{
if (type.BaseType != null && type.IsSubclassOf("System.Attribute", Cache))
{
Log.DebugLine(this, "-----------------------------------");
Log.DebugLine(this, "checking {0}", type);
if (!type.IsSealed && !type.IsAbstract)
{
if (type.ExternallyVisible(Cache))
{
Log.DebugLine(this, "{0} has no usage attribute", type.Name);
Reporter.TypeFailed(type, CheckID, string.Empty);
}
}
}
}
示例5: VisitType
public void VisitType(TypeDefinition type)
{
if (!type.IsSealed && type.ExternallyVisible(Cache))
{
Log.DebugLine(this, "-----------------------------------");
Log.DebugLine(this, "{0}", type);
foreach (MethodDefinition method in type.Methods)
{
if (method.IsPrivate && !method.IsReuseSlot)
{
Log.DebugLine(this, "{0} is an explicit implementation", method);
string name = method.Name.Substring(method.Name.LastIndexOf('.') + 1);
bool found = false;
MethodDefinition[] methods = type.Methods.GetMethod(name);
foreach (MethodDefinition candidate in methods)
{
Log.DebugLine(this, " checking {0}", candidate);
if (!candidate.IsPrivate)
{
Log.DebugLine(this, " it's an alternative");
found = true;
break;
}
}
if (!found)
{
string details = "Method: " + name;
Reporter.TypeFailed(type, CheckID, details);
break;
}
}
}
}
}
示例6: VisitType
public void VisitType(TypeDefinition candidate)
{
if (!candidate.IsAbstract && !candidate.ExternallyVisible(Cache) && candidate.IsClass && !candidate.IsSealed)
{
if (candidate.FullName != "<Module>" && !candidate.IsCompilerGenerated())
{
Log.DebugLine(this, "checking {0}", candidate);
foreach (TypeDefinition type in Cache.Types)
{
if (type.IsSubclassOf(candidate, Cache))
{
// Log.DebugLine(this, " is base class for {0} [{1}]", type, type.BaseType);
return;
}
// else
// Log.DebugLine(this, " not a base class for {0} [{1}]", type, type.BaseType);
}
// Log.DebugLine(this, " failed");
Reporter.TypeFailed(candidate, CheckID, string.Empty);
}
}
}
示例7: OnNeedsCheck
protected override bool OnNeedsCheck(TypeDefinition type, MethodDefinition method)
{
if (type.ExternallyVisible(Cache))
return method.IsAssembly;
else
return method.IsPublic || method.IsAssembly;
}
示例8: VisitType
public void VisitType(TypeDefinition type)
{
if (type.ExternallyVisible(Cache))
{
m_types.Add(type.FullName);
if (m_namespaces.IndexOf(type.Namespace) < 0) // namespaces only matter if they have a public type
m_namespaces.Add(type.Namespace);
}
}