• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IReportViolations类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IReportViolations的典型用法代码示例。如果您正苦于以下问题:C# IReportViolations类的具体用法?C# IReportViolations怎么用?C# IReportViolations使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IReportViolations类属于命名空间,在下文中一共展示了IReportViolations类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: UseFlagsAttributeRule

		public UseFlagsAttributeRule(AssemblyCache cache, IReportViolations reporter) 
			: base(cache, reporter, "D1019")
		{
			long mask = 1;
			for (int i = 0; i < 63; ++i)
			{
				m_powers.Add(mask);
				mask = mask << 1;
			}
			m_powers.Add(mask);
		}
开发者ID:dbremner,项目名称:smokey,代码行数:11,代码来源:UseFlagsAttributeRule.cs


示例2: Rule

		protected Rule(AssemblyCache cache, IReportViolations reporter, string checkID)
		{
			DBC.Pre(cache != null, "cache is null");
			DBC.Pre(reporter != null, "reporter is null");
			DBC.Pre(!string.IsNullOrEmpty(checkID), "checkID is null or empty");

			Cache = cache;
			Reporter = reporter;
			CheckID = checkID;
			Runtime = TargetRuntime.NET_1_0;
		}
开发者ID:dbremner,项目名称:smokey,代码行数:11,代码来源:Rule.cs


示例3: NonLocalizedGuiRule

		public NonLocalizedGuiRule(AssemblyCache cache, IReportViolations reporter) 
			: base(cache, reporter, "G1002")
		{
			m_enabled = Settings.Get("*localized*", "true") == "true";
			Log.TraceLine(this, "enabled: {0}", m_enabled);
			
			string custom = Settings.Get("localize", string.Empty);
			foreach (string name in custom.Split(';'))
			{
				Log.TraceLine(this, "using custom: {0}", name);
				m_custom.Add(" " + name + "(");		// add some goo so we match only what we should
			}
		}
开发者ID:dbremner,项目名称:smokey,代码行数:13,代码来源:NonLocalizedGuiRule.cs


示例4: OperatorAlternativeRule

		public OperatorAlternativeRule(AssemblyCache cache, IReportViolations reporter) 
			: base(cache, reporter, "D1033")
		{
			m_table.Add("op_Addition", "Add");
			m_table.Add("op_Subtraction", "Subtract");
			m_table.Add("op_Multiply", "Multiply");
			m_table.Add("op_Division", "Divide");
			m_table.Add("op_Modulus", "Mod");
			m_table.Add("op_GreaterThan", "Compare");
			m_table.Add("op_GreaterThanOrEqual", "Compare");
			m_table.Add("op_LessThan", "Compare");
			m_table.Add("op_LessThanOrEqual", "Compare");
			m_table.Add("op_Inequality", "Equals");
			m_table.Add("op_Equality", "Equals");
		}
开发者ID:dbremner,项目名称:smokey,代码行数:15,代码来源:OperatorAlternativeRule.cs


示例5: SpecialFolderRule

		public SpecialFolderRule(AssemblyCache cache, IReportViolations reporter) 
			: base(cache, reporter, "PO1003")
		{
			string user = Environment.UserName;
			
			Array values = Enum.GetValues(typeof(Environment.SpecialFolder));			
			foreach (object o in values)
			{
				Environment.SpecialFolder name = (Environment.SpecialFolder) o;
				string path = Environment.GetFolderPath(name);
				if (path.Length > 0)
				{
					path = path.Replace(user, "*");
					if (!m_globs.ContainsKey(name))
						m_globs.Add(name, path.Split(Path.DirectorySeparatorChar));
				}
			}
		}
开发者ID:dbremner,项目名称:smokey,代码行数:18,代码来源:SpecialFolderRule.cs


示例6: NoStaticRemoveRule

		public NoStaticRemoveRule(AssemblyCache cache, IReportViolations reporter) 
			: base(cache, reporter, "C1026")
		{
			// Collections.Generic
			m_adders.Add  ("System.Collections.Generic.Dictionary`", new List<string>{"Add", "set_Item"});
			m_removers.Add("System.Collections.Generic.Dictionary`", new List<string>{"Clear", "Remove"});
			
			m_adders.Add  ("System.Collections.Generic.HashSet`", new List<string>{"Add", "UnionWith"});
			m_removers.Add("System.Collections.Generic.HashSet`", new List<string>{"Clear", "ExceptWith", "IntersectWith", "Remove", "RemoveWhere", "SymmetricExceptWith"});
			
			m_adders.Add  ("System.Collections.Generic.List`", new List<string>{"Add", "AddRange", "Insert", "InsertRange"});
			m_removers.Add("System.Collections.Generic.List`", new List<string>{"Clear", "Remove", "RemoveAll", "RemoveAt", "RemoveRange"});
			
			m_adders.Add  ("System.Collections.Generic.Queue`", new List<string>{"Enqueue"});
			m_removers.Add("System.Collections.Generic.Queue`", new List<string>{"Clear", "Dequeue"});
			
			m_adders.Add  ("System.Collections.Generic.SortedDictionary`", new List<string>{"Add", "set_Item"});
			m_removers.Add("System.Collections.Generic.SortedDictionary`", new List<string>{"Clear", "Remove"});
			
			m_adders.Add  ("System.Collections.Generic.Stack`", new List<string>{"Push"});
			m_removers.Add("System.Collections.Generic.Stack`", new List<string>{"Clear", "Pop"});
			
			// Collections
			m_adders.Add  ("System.Collections.ArrayList", new List<string>{"Add", "AddRange", "Insert", "InsertRange"});
			m_removers.Add("System.Collections.ArrayList", new List<string>{"Clear", "Remove", "RemoveAt", "RemoveRange"});
			
			m_adders.Add  ("System.Collections.Hashtable", new List<string>{"Add", "set_Item"});
			m_removers.Add("System.Collections.Hashtable", new List<string>{"Clear", "Remove"});
			
			m_adders.Add  ("System.Collections.Queue", new List<string>{"Enqueue"});
			m_removers.Add("System.Collections.Queue", new List<string>{"Clear", "Dequeue"});
			
			m_adders.Add  ("System.Collections.SortedList", new List<string>{"Add", "set_Item"});
			m_removers.Add("System.Collections.SortedList", new List<string>{"Clear", "Remove", "RemoveAt"});
			
		}
开发者ID:dbremner,项目名称:smokey,代码行数:36,代码来源:NoStaticRemoveRule.cs


示例7: OnCreate

 protected override Rule OnCreate(AssemblyCache cache, IReportViolations reporter)
 {
     return new EventHandlerRule(cache, reporter);
 }
开发者ID:dbremner,项目名称:smokey,代码行数:4,代码来源:EventHandlerTest.cs


示例8: OnCreate

 protected override Rule OnCreate(AssemblyCache cache, IReportViolations reporter)
 {
     return new OptionalSerializationRule(cache, reporter);
 }
开发者ID:dbremner,项目名称:smokey,代码行数:4,代码来源:OptionalSerializationTest.cs


示例9: OnCreate

 protected override Rule OnCreate(AssemblyCache cache, IReportViolations reporter)
 {
     return new SealedInheritanceDemandRule(cache, reporter);
 }
开发者ID:dbremner,项目名称:smokey,代码行数:4,代码来源:SealedInheritanceDemandTest.cs


示例10: DllImportExtensionRule

		public DllImportExtensionRule(AssemblyCache cache, IReportViolations reporter) 
			: base(cache, reporter, "PO1002")
		{
		}
开发者ID:dbremner,项目名称:smokey,代码行数:4,代码来源:DllImportExtensionRule.cs


示例11: PrivateNeedsDoRule

		// The checkID must match the id in the xml. Note that multiple classes can
		// share the same checkID.
		public PrivateNeedsDoRule(AssemblyCache cache, IReportViolations reporter) 
			: base(cache, reporter, "CU1000 - example custom rules")
		{
		}
开发者ID:dbremner,项目名称:smokey,代码行数:6,代码来源:PrivateNeedsDoRule.cs


示例12: CompareFloatsRule

		// This is inspired by the Gendarme rule authored by Lukasz Knop
		// although the code is completely different.
		public CompareFloatsRule(AssemblyCache cache, IReportViolations reporter) 
			: base(cache, reporter, "R1009")
		{
		}
开发者ID:dbremner,项目名称:smokey,代码行数:6,代码来源:CompareFloatsRule.cs


示例13: NullFieldRule

		public NullFieldRule(AssemblyCache cache, IReportViolations reporter) 
			: base(cache, reporter, "C1017")
		{
		}
开发者ID:dbremner,项目名称:smokey,代码行数:4,代码来源:NullFieldRule.cs


示例14: StringSpellingRule

		public StringSpellingRule(AssemblyCache cache, IReportViolations reporter) 
			: base(cache, reporter, "C1000")
		{
		}
开发者ID:dbremner,项目名称:smokey,代码行数:4,代码来源:StringSpellingRule.cs


示例15: ThrowDerivedRule

		public ThrowDerivedRule(AssemblyCache cache, IReportViolations reporter) 
			: base(cache, reporter, "MS1012")
		{
		}
开发者ID:dbremner,项目名称:smokey,代码行数:4,代码来源:ThrowDerivedRule.cs


示例16: OnCreate

 protected override Rule OnCreate(AssemblyCache cache, IReportViolations reporter)
 {
     return new GodClassRule(cache, reporter, 5);
 }
开发者ID:dbremner,项目名称:smokey,代码行数:4,代码来源:GodClassTest.cs


示例17: RecursiveLock2Rule

		public RecursiveLock2Rule(AssemblyCache cache, IReportViolations reporter) 
			: base(cache, reporter, "R1038")
		{
		}
开发者ID:dbremner,项目名称:smokey,代码行数:4,代码来源:RecursiveLock2Rule.cs


示例18: DestroyStackTraceRule

		public DestroyStackTraceRule(AssemblyCache cache, IReportViolations reporter) 
			: base(cache, reporter, "MS1003")
		{
		}
开发者ID:dbremner,项目名称:smokey,代码行数:4,代码来源:DestroyStackTraceRule.cs


示例19: OnCreate

 protected abstract Rule OnCreate(AssemblyCache cache, IReportViolations reporter);
开发者ID:dbremner,项目名称:smokey,代码行数:1,代码来源:AssemblyTest.cs


示例20: BaseSerializable1Rule

		public BaseSerializable1Rule(AssemblyCache cache, IReportViolations reporter) 
			: base(cache, reporter, "R1017")
		{
		}
开发者ID:dbremner,项目名称:smokey,代码行数:4,代码来源:BaseSerializable1Rule.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IRepository类代码示例发布时间:2022-05-24
下一篇:
C# IReportModel类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap