[FxCop.设计规则]1. 抽象类不应该拥有构造函数,FxCop.设,FxCop.设计,xCop.设计规,Cop.设计规则,op.设计规则,p.设计规则1,.设计规则1.,设计规则1.抽,计规则1.抽象,规则1.抽象类,则1.抽象类不,1.抽象类不应,1.抽象类不应该,.抽象类不应该拥,抽象类不应该拥有,象类不应该拥有构,类不应该拥有构造,不应该拥有构造函 [FxCop.设计规则]1. 抽象类不应该拥有构造函数----编程资料集中营--八角123--bajiao123.com
编程资料集中营
 | 网站首页 | 文章中心 | 编程资料2 | 软件下载 | BT下载 | 八卦星闻 | 音乐在线 | 在线游戏 | 免费电影 | 进入问吧 | 
[FxCop.设计规则]1. 抽象类不应该拥有构造函数,1.抽象类不应该拥有构造函数原文引用:AbstracttypesshouldnothaveconstructorsTypeName:AbstractTypesShouldNotHaveConstructorsCheckId:CA1012Category:Microsoft.DesignMessageLevel:CriticalWarningCertainty,
您现在的位置: 编程资料,学习资料,c,c++,vc,vc++,java,jsp,j2ee,j2me,asp,php >> 文章中心 >> .NET 专区 >> NET 技术 >> 文章正文
【字体:
[FxCop.设计规则]1. 抽象类不应该拥有构造函数   进入问吧

本站地址:http://www.bajiao123.com

作者:admin    文章来源:本站    点击数:    更新时间:2007-6-10    

[FxCop.设计规则]1. 抽象类不应该拥有构造函数

Constructors on abstract types can only be called by derived types. Because public constructors create instances of a type, and you cannot create instances of an abstract type, an abstract type with a public constructor is incorrectly designed.

How to Fix Violations

To fix a violation of this rule, either make the constructor protected, or do not declare the type as abstract.

When to Exclude Messages

Do not exclude a message from this rule.

Example Code

The following example contains an abstract type that violates this rule, and an abstract type that is correctly implemented.

[C#]

using System;

 

上一页  [1] [2] [3] [4] [5] 下一页

   

进入问吧

本站地址:http://www.bajiao123.com

文章录入:admin    责任编辑:admin 
高级搜索
编程资料集中营