[FxCop.设计规则]6. 避免使用输出参数[8]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 cajon 的 blog

#a52a2a">   }

}

the following application illustrates the user's experience. the call to the redesigned library (usethesimplifiedclass method) is more straightforward, and the information returned by the method is easily managed. the output from the two methods is identical.

[c#]

using system;
using designlibrary;

 

namespace testdesignlibrary
{
   public class usecomplexmethod
   {
      static void usethecomplicatedclass()
      {
         // using the version with the ref and out parameters. 
         // you do not have to initialize an out parameter.

 

         string[] reply = new string[5];

 

         // you must initialize a ref parameter.
         actions[] action = {actions.unknown,actions.unknown,
                             actions.unknown,actions.unknown,
                             actions.unknown,actions.unknown}; 
         bool[] disposition= new bool[5];
         int i = 0;

 

本文关键:[FxCop.设计规则]6. 避免使用输出参数
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top