當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。