当前位置: 首页>>代码示例>>C#>>正文


C# TypeDefinition.ExternallyVisible方法代码示例

本文整理汇总了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;
		}
开发者ID:dbremner,项目名称:smokey,代码行数:7,代码来源:VisibleFieldsRule.cs

示例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);
				}
			}
		}
开发者ID:dbremner,项目名称:smokey,代码行数:13,代码来源:PreferredTermRule.cs

示例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);
				}
			}
		}
开发者ID:dbremner,项目名称:smokey,代码行数:17,代码来源:NotInstantiatedRule.cs

示例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);
					}
				}
			}
		}
开发者ID:dbremner,项目名称:smokey,代码行数:17,代码来源:UnsealedAttributeRule.cs

示例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;
						}
					}
				}
			}
		}
开发者ID:dbremner,项目名称:smokey,代码行数:39,代码来源:BadExplicitImplementationRule.cs

示例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);
				}
			}
		}
开发者ID:dbremner,项目名称:smokey,代码行数:24,代码来源:NotSealedRule.cs

示例7: OnNeedsCheck

		protected override bool OnNeedsCheck(TypeDefinition type, MethodDefinition method) 
		{
			if (type.ExternallyVisible(Cache))
				return method.IsAssembly;
			else
				return method.IsPublic || method.IsAssembly;
		}
开发者ID:dbremner,项目名称:smokey,代码行数:7,代码来源:ValidateArgsRule.cs

示例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);
			}
		}
开发者ID:dbremner,项目名称:smokey,代码行数:10,代码来源:IdentifierCasingRule.cs


注:本文中的Mono.Cecil.TypeDefinition.ExternallyVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。