﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>博客园-With or without you</title><link>http://www.cnblogs.com/explup/</link><description>爆发</description><language>zh-cn</language><lastBuildDate>Fri, 29 Aug 2008 01:26:54 GMT</lastBuildDate><pubDate>Fri, 29 Aug 2008 01:26:54 GMT</pubDate><ttl>60</ttl><item><title>获得以TestMethodAttribue为属性的方法的名称</title><link>http://www.cnblogs.com/explup/archive/2008/08/11/1264980.html</link><dc:creator>one</dc:creator><author>one</author><pubDate>Mon, 11 Aug 2008 02:50:00 GMT</pubDate><guid>http://www.cnblogs.com/explup/archive/2008/08/11/1264980.html</guid><wfw:comment>http://www.cnblogs.com/explup/comments/1264980.html</wfw:comment><comments>http://www.cnblogs.com/explup/archive/2008/08/11/1264980.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/explup/comments/commentRss/1264980.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/explup/services/trackbacks/1264980.html</trackback:ping><description><![CDATA[<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="cnblogs_code"><img id="Code_Closed_Image_104740" onclick="this.style.display='none'; document.getElementById('Code_Closed_Text_104740').style.display='none'; document.getElementById('Code_Open_Image_104740').style.display='inline'; document.getElementById('Code_Open_Text_104740').style.display='inline';" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" width="11" align="top"><img id="Code_Open_Image_104740" style="display: none" onclick="this.style.display='none'; document.getElementById('Code_Open_Text_104740').style.display='none'; getElementById('Code_Closed_Image_104740').style.display='inline'; getElementById('Code_Closed_Text_104740').style.display='inline';" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" width="11" align="top"><span class="cnblogs_code_Collapse" id="Code_Closed_Text_104740">Code</span><span id="Code_Open_Text_104740" style="display: none"><br />
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">public</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">static</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">string</span><span style="color: #000000">&nbsp;GetCaseMethodName()<br />
<img id="Codehighlighter1_50_558_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_50_558_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_50_558_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_50_558_Closed_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_50_558_Closed_Image" style="display: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_50_558_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_50_558_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_50_558_Open_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_50_558_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_50_558_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">try</span><span style="color: #000000"><br />
<img id="Codehighlighter1_80_519_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_80_519_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_80_519_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_80_519_Closed_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img id="Codehighlighter1_80_519_Closed_Image" style="display: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_80_519_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_80_519_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_80_519_Open_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_80_519_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_80_519_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StackTrace&nbsp;st&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;StackTrace();<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StackFrame[]&nbsp;stackFrames&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;st.GetFrames();<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">foreach</span><span style="color: #000000">&nbsp;(StackFrame&nbsp;sf&nbsp;</span><span style="color: #0000ff">in</span><span style="color: #000000">&nbsp;stackFrames)<br />
<img id="Codehighlighter1_262_468_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_262_468_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_262_468_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_262_468_Closed_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img id="Codehighlighter1_262_468_Closed_Image" style="display: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_262_468_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_262_468_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_262_468_Open_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_262_468_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_262_468_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MethodBase&nbsp;mb&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;sf.GetMethod();<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(mb.GetCustomAttributes(</span><span style="color: #0000ff">typeof</span><span style="color: #000000">(TestMethodAttribute),&nbsp;</span><span style="color: #0000ff">false</span><span style="color: #000000">).Length&nbsp;</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;</span><span style="color: #800080">0</span><span style="color: #000000">)<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;mb.Name;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">string</span><span style="color: #000000">.Empty;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_538_548_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_538_548_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_538_548_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_538_548_Closed_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img id="Codehighlighter1_538_548_Closed_Image" style="display: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_538_548_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_538_548_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_538_548_Open_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">catch</span><span style="color: #000000">&nbsp;</span><span id="Codehighlighter1_538_548_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_538_548_Open_Text"><span style="color: #000000">{&nbsp;</span><span style="color: #0000ff">throw</span><span style="color: #000000">;&nbsp;}</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div>
<img src ="http://www.cnblogs.com/explup/aggbug/1264980.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41947/" target="_blank">[新闻]施密特：谷歌计划十月份开始推进与雅虎合作</a>]]></description></item><item><title>转载：[你必须知道的.NET] 第一回：恩怨情仇：is和as </title><link>http://www.cnblogs.com/explup/archive/2008/07/31/1257272.html</link><dc:creator>one</dc:creator><author>one</author><pubDate>Thu, 31 Jul 2008 06:49:00 GMT</pubDate><guid>http://www.cnblogs.com/explup/archive/2008/07/31/1257272.html</guid><wfw:comment>http://www.cnblogs.com/explup/comments/1257272.html</wfw:comment><comments>http://www.cnblogs.com/explup/archive/2008/07/31/1257272.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/explup/comments/commentRss/1257272.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/explup/services/trackbacks/1257272.html</trackback:ping><description><![CDATA[<p>原文：<a href="http://www.cnblogs.com/anytao/archive/2007/04/07/must_net_01.html">http://www.cnblogs.com/anytao/archive/2007/04/07/must_net_01.html</a>
<p>本文将介绍以下内容：
<p>&#8226; 类型转换</p>
<p>&#8226; is/as操作符小议&nbsp;</p>
<p><strong><font color="#0000ff">1.&nbsp;引言</font></strong>&nbsp;<br />
<br />
类型安全是.NET设计之初重点考虑的内容之一，对于程序设计者来说，完全把握系统数据的类型安全，经常是力不从心的问题。现在，这一切已经在微软大牛们的设计框架中为你解决了。在.NET中，一切类型都必须集成自System.Object类型，因此我们可以很容易的获得对象的准确类型，方法是：GetType()方法。那么.NET中的类型转换，应该考虑的地方有那些呢？</p>
<p><strong><font color="#0000ff">2. 概念引入</font></strong></p>
<p>类型转换包括显示转换和隐式转换，在.NET中类型转换的基本规则如下：</p>
<ul>
    <li>任何类型都可以安全的转换为其基类类型，可以由隐式转换来完成；</li>
    <li>任何类型转换为其派生类型时，必须进行显示转换，转换的规则是：（类型名）对象名；</li>
    <li>使用GetType可以取得任何对象的精确类型；</li>
    <li>基本类型可以使用Covert类实现类型转换；</li>
    <li>除了string以外的其他类型都有Parse方法，用于将字符串类型转换为对应的基本类型；</li>
    <li>值类型和引用类型的转换机制称为装箱（boxing）和拆箱（unboxing）。 </li>
</ul>
<p><strong><font color="#0000ff">3. 原理与示例说明</font></strong></p>
<p>浅谈了类型转换的几个普遍关注的方面，该将主要精力放在is、as操作符的恩怨情仇上了。类型转换将是个较大的话题，留于适当的时机讨论。<br />
<br />
is/as操作符，是C#中用于类型转换的，提供了对类型兼容性的判断，从而使得类型转换控制在安全的范畴，提供了灵活的类型转换控制。<br />
<br />
is的规则如下：</p>
<ul>
    <li>检查对象类型的兼容性，并返回结果，true或者false；</li>
    <li>不会抛出异常；</li>
    <li>如果对象为null，则返回值永远为false。 </li>
</ul>
<p>其典型用法为：</p>
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #008080">&nbsp;1</span><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #0000ff">object</span><span style="color: #000000">&nbsp;o&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">object</span><span style="color: #000000">();<br />
</span><span style="color: #008080">&nbsp;2</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">&nbsp;3</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #0000ff">class</span><span style="color: #000000">&nbsp;A<br />
</span><span style="color: #008080">&nbsp;4</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">&nbsp;5</span><span style="color: #000000"><img id="Codehighlighter1_35_38_Open_Image" onclick="this.style.display='none'; Codehighlighter1_35_38_Open_Text.style.display='none'; Codehighlighter1_35_38_Closed_Image.style.display='inline'; Codehighlighter1_35_38_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_35_38_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_35_38_Closed_Text.style.display='none'; Codehighlighter1_35_38_Open_Image.style.display='inline'; Codehighlighter1_35_38_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"></span><span id="Codehighlighter1_35_38_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_35_38_Open_Text"><span style="color: #000000">{<br />
</span><span style="color: #008080">&nbsp;6</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">&nbsp;7</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />}</span></span><span style="color: #000000"><br />
</span><span style="color: #008080">&nbsp;8</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">&nbsp;9</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(o&nbsp;</span><span style="color: #0000ff">is</span><span style="color: #000000">&nbsp;A)&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">执行第一次类型兼容检查</span><span style="color: #008000"><br />
</span><span style="color: #008080">10</span><span style="color: #008000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000"><br />
</span><span style="color: #008080">11</span><span style="color: #000000"><img id="Codehighlighter1_69_103_Open_Image" onclick="this.style.display='none'; Codehighlighter1_69_103_Open_Text.style.display='none'; Codehighlighter1_69_103_Closed_Image.style.display='inline'; Codehighlighter1_69_103_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_69_103_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_69_103_Closed_Text.style.display='none'; Codehighlighter1_69_103_Open_Image.style.display='inline'; Codehighlighter1_69_103_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"></span><span id="Codehighlighter1_69_103_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_69_103_Open_Text"><span style="color: #000000">{<br />
</span><span style="color: #008080">12</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">13</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;A&nbsp;a&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;(A)&nbsp;o;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">执行第二次类型兼容检查</span><span style="color: #008000"><br />
</span><span style="color: #008080">14</span><span style="color: #008000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" /></span><span style="color: #000000"><br />
</span><span style="color: #008080">15</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />}</span></span><span style="color: #000000"><br />
</span><span style="color: #008080">16</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">17</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /></span></div>
<p>&nbsp;as的规则如下：</p>
<ul>
    <li>检查对象类型的兼容性，并返回结果，如果不兼容就返回null；</li>
    <li>不会抛出异常；</li>
    <li>如果结果判断为空，则强制执行类型转换将抛出NullReferenceException异常。 </li>
</ul>
<p>其典型用法为：&nbsp;</p>
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #008080">&nbsp;1</span><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #0000ff">object</span><span style="color: #000000">&nbsp;o&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">object</span><span style="color: #000000">();<br />
</span><span style="color: #008080">&nbsp;2</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">&nbsp;3</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #0000ff">class</span><span style="color: #000000">&nbsp;B<br />
</span><span style="color: #008080">&nbsp;4</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">&nbsp;5</span><span style="color: #000000"><img id="Codehighlighter1_35_38_Open_Image" onclick="this.style.display='none'; Codehighlighter1_35_38_Open_Text.style.display='none'; Codehighlighter1_35_38_Closed_Image.style.display='inline'; Codehighlighter1_35_38_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_35_38_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_35_38_Closed_Text.style.display='none'; Codehighlighter1_35_38_Open_Image.style.display='inline'; Codehighlighter1_35_38_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"></span><span id="Codehighlighter1_35_38_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_35_38_Open_Text"><span style="color: #000000">{<br />
</span><span style="color: #008080">&nbsp;6</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">&nbsp;7</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />}</span></span><span style="color: #000000"><br />
</span><span style="color: #008080">&nbsp;8</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">&nbsp;9</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" />B&nbsp;b&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;o&nbsp;</span><span style="color: #0000ff">as</span><span style="color: #000000">&nbsp;B;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">执行一次类型兼容检查</span><span style="color: #008000"><br />
</span><span style="color: #008080">10</span><span style="color: #008000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000"><br />
</span><span style="color: #008080">11</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(b&nbsp;</span><span style="color: #000000">!=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">null</span><span style="color: #000000">)<br />
</span><span style="color: #008080">12</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">13</span><span style="color: #000000"><img id="Codehighlighter1_86_133_Open_Image" onclick="this.style.display='none'; Codehighlighter1_86_133_Open_Text.style.display='none'; Codehighlighter1_86_133_Closed_Image.style.display='inline'; Codehighlighter1_86_133_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img id="Codehighlighter1_86_133_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_86_133_Closed_Text.style.display='none'; Codehighlighter1_86_133_Open_Image.style.display='inline'; Codehighlighter1_86_133_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"></span><span id="Codehighlighter1_86_133_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_86_133_Open_Text"><span style="color: #000000">{&nbsp;&nbsp;<br />
</span><span style="color: #008080">14</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">15</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;MessageBox.Show(</span><span style="color: #000000">"</span><span style="color: #000000">b&nbsp;is&nbsp;B's&nbsp;instance.</span><span style="color: #000000">"</span><span style="color: #000000">);<br />
</span><span style="color: #008080">16</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">17</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />}</span></span><span style="color: #000000"><br />
</span><span style="color: #008080">18</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">19</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /></span></div>
<p><strong><font color="#0000ff">4. 结论</font></strong></p>
<p>纵上比较，is/as操作符，提供了更加灵活的类型转型方式，但是as操作符在执行效率上更胜一筹，我们在实际的编程中应该体会其异同，酌情量才。&nbsp;<br />
<img height="20" src="http://images.cnblogs.com/cnblogs_com/anytao/MyBanner.jpg" width="500" border="0"  alt="" /><strong><br />
<font color="#0000ff">参考文献</font></strong>：</p>
<p>（USA）Jeffrey Richter, Applied Microsoft .NET Framework Programming</p>
<p>&nbsp;(USA) Stanley B. Lippman, C# Primer</p>
<img src ="http://www.cnblogs.com/explup/aggbug/1257272.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41946/" target="_blank">[新闻]微软加快XP专业版反盗版步伐</a>]]></description></item><item><title>一个小项目的苦恼</title><link>http://www.cnblogs.com/explup/archive/2008/07/22/1248696.html</link><dc:creator>one</dc:creator><author>one</author><pubDate>Tue, 22 Jul 2008 06:29:00 GMT</pubDate><guid>http://www.cnblogs.com/explup/archive/2008/07/22/1248696.html</guid><wfw:comment>http://www.cnblogs.com/explup/comments/1248696.html</wfw:comment><comments>http://www.cnblogs.com/explup/archive/2008/07/22/1248696.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/explup/comments/commentRss/1248696.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/explup/services/trackbacks/1248696.html</trackback:ping><description><![CDATA[摘要: &nbsp;&nbsp;<a href='http://www.cnblogs.com/explup/archive/2008/07/22/1248696.html'>阅读全文</a><img src ="http://www.cnblogs.com/explup/aggbug/1248696.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41945/" target="_blank">[新闻]Mozilla与谷歌续签三年搜索合同</a>]]></description></item><item><title>Unable to find manifest signing certificate in the certificate store.</title><link>http://www.cnblogs.com/explup/archive/2008/07/10/1239824.html</link><dc:creator>one</dc:creator><author>one</author><pubDate>Thu, 10 Jul 2008 03:11:00 GMT</pubDate><guid>http://www.cnblogs.com/explup/archive/2008/07/10/1239824.html</guid><wfw:comment>http://www.cnblogs.com/explup/comments/1239824.html</wfw:comment><comments>http://www.cnblogs.com/explup/archive/2008/07/10/1239824.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/explup/comments/commentRss/1239824.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/explup/services/trackbacks/1239824.html</trackback:ping><description><![CDATA[<br />
RE:I got this when I renamed my C# project then tried to publish it. To solve, I went to the "Signing" tab of the project properties and unchecked "Sign the ClickOnce manifests". Good luck!
<img src ="http://www.cnblogs.com/explup/aggbug/1239824.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41944/" target="_blank">[新闻]CBS推出新版CNET重推视频</a>]]></description></item><item><title>Static</title><link>http://www.cnblogs.com/explup/archive/2008/07/08/1238032.html</link><dc:creator>one</dc:creator><author>one</author><pubDate>Tue, 08 Jul 2008 03:20:00 GMT</pubDate><guid>http://www.cnblogs.com/explup/archive/2008/07/08/1238032.html</guid><wfw:comment>http://www.cnblogs.com/explup/comments/1238032.html</wfw:comment><comments>http://www.cnblogs.com/explup/archive/2008/07/08/1238032.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/explup/comments/commentRss/1238032.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/explup/services/trackbacks/1238032.html</trackback:ping><description><![CDATA[<h3>What does it mean that a method is static?</h3>
<p>A static method is simply one that is disassociated from any instance of its containing class. The more common alternative is an instance method, which is a method whose result is dependent on the state of a particular instance of the class it belongs to.</p>
<p>For example, both of these statements would return precisely the same string, but accomplish it through different types of methods:</p>
<div class="wp_syntax" style="padding-bottom: 0px">
<div class="code">
<pre class="csharp"><span style="color: #008080; font-style: italic">// ToString() is an instance method of the DateTime class.</span>
<span style="color: #008080; font-style: italic">//  Its result depends on the value of each DateTime instance.</span>
<span style="color: #0600ff">return</span> DateTime.<span style="color: #0000ff">Now</span>.<span style="color: #0000ff">ToString</span><span style="color: #000000">(</span><span style="color: #000000">)</span>;
&nbsp;
<span style="color: #008080; font-style: italic">// String.Format is a static method of the String class.</span>
<span style="color: #008080; font-style: italic">//  Its result is not related to any instance of the String.</span>
<span style="color: #0600ff">return</span> <span style="color: #ff0000">String</span>.<span style="color: #0000ff">Format</span><span style="color: #000000">(</span><span style="color: #808080">"{0}"</span>, DateTime.<span style="color: #0000ff">Now</span><span style="color: #000000">)</span>;</pre>
</div>
</div>
<p>The key difference to understand is that a static method can be called <em>without</em> setting up a proper instance of the class it belongs to. </p>
<p>In a sense, it is <strong>a stateless method</strong>.</p>
<img src ="http://www.cnblogs.com/explup/aggbug/1238032.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41943/" target="_blank">[新闻]轮回－新浪推出Facebook模式的SNS</a>]]></description></item><item><title>Const and readonly</title><link>http://www.cnblogs.com/explup/archive/2008/07/08/1238021.html</link><dc:creator>one</dc:creator><author>one</author><pubDate>Tue, 08 Jul 2008 03:08:00 GMT</pubDate><guid>http://www.cnblogs.com/explup/archive/2008/07/08/1238021.html</guid><wfw:comment>http://www.cnblogs.com/explup/comments/1238021.html</wfw:comment><comments>http://www.cnblogs.com/explup/archive/2008/07/08/1238021.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/explup/comments/commentRss/1238021.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/explup/services/trackbacks/1238021.html</trackback:ping><description><![CDATA[<p align="left"><span style="color: red"><strong>The final advantage of using const over readonly is performance:</strong></span> Known <br />
constant values can generate slightly more efficient code than the variable<br />
accesses necessary for readonly values. <strong><span style="color: red">However, any gains are slight and <br />
should be weighed against the decreased flexibility.</span></strong> Be sure to profile <br />
performance differences before giving up the flexibility.<br />
</p>
<br />
<p align="left"><strong><span style="color: red">const must be used when the value must be available at compile times: <br />
attribute parameters and enum definitions, and those rare times when <br />
you mean to define a value that does not change from release to release. <br />
For everything else, prefer the increased flexibility of readonly constants.</span></strong></p>
<img src ="http://www.cnblogs.com/explup/aggbug/1238021.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41943/" target="_blank">[新闻]轮回－新浪推出Facebook模式的SNS</a>]]></description></item><item><title>7月IELTS</title><link>http://www.cnblogs.com/explup/archive/2008/06/30/1232271.html</link><dc:creator>one</dc:creator><author>one</author><pubDate>Mon, 30 Jun 2008 01:52:00 GMT</pubDate><guid>http://www.cnblogs.com/explup/archive/2008/06/30/1232271.html</guid><wfw:comment>http://www.cnblogs.com/explup/comments/1232271.html</wfw:comment><comments>http://www.cnblogs.com/explup/archive/2008/06/30/1232271.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/explup/comments/commentRss/1232271.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/explup/services/trackbacks/1232271.html</trackback:ping><description><![CDATA[<span style="color: black; line-height: 150%; font-family: Verdana"><font face="Courier New"><span style="color: #0000ff"><span style="line-height: 150%; font-family: Verdana"><strong><font face="Courier New">1）</font>More and more people use <a onclick="javascript:tagshow(event, 'the');" href="javascript:;" target="_self"><u><strong>the</strong></u></a> mobile phone or computer to communicate, and no longer write letters to each other. Some people think the skills of letter writing will soon disappear completely. Do you agree or disagree? How important do you think letter-writing is?<br />
<p><strong><span style="color: #ff6600">In the new millennium, rapid developed telecommunication technology makes our lives much easier and faster than ever before, inducing a large scale sweeping trend that the proliferation of mobile phones and computers is increasingly popular. In this case, whether the traditional letter should be replaced by such modern techniques has aroused severe debate，and some even claim that the skills of letter will disappear completely. Speaking for me, I totally disagree with this view. </span></strong></p>
<p><br />
<strong><span style="color: #ff6600">In this day and age, the traditional means of writing a letter still plays a pivotal role and its advantages cannot be neglected. To begin with, not only writing a letter is to transfer information, but it represents a more sincere feeling as well- that is to say, a traditional letter transfers some feelings of sender, be it happy or sorry, angry or love, rather than merely simple words to the receiver. To illustrate, it is usual that companies would like to send formal invitation letters to guests for conferences and lovers would like to write love letters to each other. In addition, considering about the increasingly severe disparity between cities and countryside, some basic infrastructures such as signal base stations and broadband are unavailable in rural areas and numerous people still cannot afford the cost of a mobile phone and computer, thus letters and post offices are still an indispensable part of the communication network. </span></strong></p>
<p><strong><span style="color: #ff6600">Admittedly, modern technology like SMS or MSN or email exert certain effects to increase efficiency, as it cut down the time wasted in transferring the message. However, such fast and convenient operations render people less careful about their words and expressions, resulting in a great many wrongly spelled characters or unsuitable sentences, which will, in turn, make misunderstanding or even degradation of the language. In contrast, when writing a letter, people will pay more attention to their words and carefully think about the contents. </span></strong></p>
<p><strong><span style="color: #ff6600">In conclusion, mobile phones or computers can increase efficiency in modern society, but they will never render the traditional writing skills outdated. Letter writing can help us concentrate on the contents, reduce the cost of deploying facilities and above all, directly and effectively show our feelings.</span></strong> </p>
<br />
</strong><span style="font-size: 10.5pt; font-family: Verdana"><strong>2）It is now possible to perform everyday tasks as banking, shopping and business transactions without meeting people face-to-face. What are the effects it may bring on the individual and the society as a whole?&nbsp;<br />
</strong></span></span></span></font><span style="font-size: 10.5pt; color: black; font-family: Verdana"><font face="Verdana">http://bbs.topsage.com/dispbbs_63_175771_9_3.html</font><br />
<span lang="EN-US" style="color: black; line-height: 150%; font-family: Verdana; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-weight: bold; mso-bidi-font-style: italic"><span style="color: #ff0000"><strong><span lang="EN-US" style="line-height: 150%; font-family: Verdana; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-weight: bold; mso-bidi-font-style: italic">）Nowadays, a lot of advertisements are aimed at children. Some people think there are lots of negative effects for children and should ban the advertisements. To what extent do you agree or disagree?<br />
</span><br />
<span style="line-height: 150%; font-family: Verdana">4）Some think the government should be responsible for ensuring the people of the country that have healthy lifestyles. Others think we should make our own living decisions. Discuss both opinions and give your opinion.</span><br />
</strong></span></span></span></span>
<img src ="http://www.cnblogs.com/explup/aggbug/1232271.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41940/" target="_blank">[新闻]惠普139亿美元完成对EDS的收购</a>]]></description></item><item><title>34个加分写作句型</title><link>http://www.cnblogs.com/explup/archive/2008/06/05/1214514.html</link><dc:creator>one</dc:creator><author>one</author><pubDate>Thu, 05 Jun 2008 07:42:00 GMT</pubDate><guid>http://www.cnblogs.com/explup/archive/2008/06/05/1214514.html</guid><wfw:comment>http://www.cnblogs.com/explup/comments/1214514.html</wfw:comment><comments>http://www.cnblogs.com/explup/archive/2008/06/05/1214514.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/explup/comments/commentRss/1214514.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/explup/services/trackbacks/1214514.html</trackback:ping><description><![CDATA[<p><strong>积极方面</strong>&nbsp;&nbsp; </p>
<p>1. give students/ citizens motivation to&#8230;给学生/公民动力去&#8230;&#8230; <br />
2. narrow the gap between the wealthy and the impoverished 减少贫富差距 <br />
3. curb crimes 控制犯罪 <br />
4. allocate money to投资于&#8230;<br />
5. promote the development of&#8230; 促进&#8230;的发展<br />
6. It is obvious that&#8230;显而易见，&#8230; <br />
7. play a key role in 起关键作用&nbsp;&nbsp; <br />
8. enhance the efficiency of&#8230;提高效率<br />
9. enrich one&#8217;s experience &#8230;丰富某人的经验<br />
10. keep society safe and stable 保持社会稳定<br />
11. have an obligation to do &#8230;有责任去&#8230;<br />
12. afford people entertainment and pleasure 给人们提供娱乐<br />
13. create employment opportunities&nbsp;&nbsp; 创造就业机会 <br />
14. put something in the first place = give priority to&#8230; 把&#8230;当成首要任务 <br />
15. is less time-consuming and more economical 省钱又省时间<br />
16. broaden one&#8217;s horizons 开阔人的眼界<br />
17. contribute to &#8230; 为&#8230;作贡献<br />
18. fulfill one's potential 发挥......的潜力<br />
</p>
<p><strong>消极方面</strong></p>
<p>19. live a stressful life生活压力大<br />
20. the competition is stiff 竞争激烈<br />
21. impair people&#8217;s health 破坏人的健康<br />
22. the population is booming 人口爆炸<br />
23. restrict the development of 限制&#8230;&#8230;的发展<br />
24. lower the efficiency of&#8230; 降低&#8230;&#8230;的效率<br />
25. stem from 某事由&#8230;导致<br />
26. suffer from 遭受<br />
27. is a threat to&#8230; 对&#8230;构成威胁<br />
28. have detrimental influence upon&nbsp; 对&#8230;产生有害的影响<br />
29. cope with&nbsp; 解决，处理<br />
30. take measures to &#8230; 采取措施&#8230;<br />
31. There is a definite link between A and B&nbsp;&nbsp;&nbsp;&nbsp; A和B之间有密切的联系<br />
32. is increasingly severe 越来越严重<br />
33. is monotonous 单调的<br />
34. create psychological problems 产生心理问题</p>
 <img src ="http://www.cnblogs.com/explup/aggbug/1214514.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41939/" target="_blank">[新闻]搜狗五笔输入法发布</a>]]></description></item><item><title>无奈的代码（同事小朱）</title><link>http://www.cnblogs.com/explup/archive/2008/04/18/1160140.html</link><dc:creator>one</dc:creator><author>one</author><pubDate>Fri, 18 Apr 2008 08:42:00 GMT</pubDate><guid>http://www.cnblogs.com/explup/archive/2008/04/18/1160140.html</guid><wfw:comment>http://www.cnblogs.com/explup/comments/1160140.html</wfw:comment><comments>http://www.cnblogs.com/explup/archive/2008/04/18/1160140.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/explup/comments/commentRss/1160140.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/explup/services/trackbacks/1160140.html</trackback:ping><description><![CDATA[<br />
最近同事小朱受到减少代码的影响，在非正常状态下写下的代码：<br />
<br />
1.构造函数给类的Property创造实例。 <br />
正常版：
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">public</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">class</span><span style="color: #000000">&nbsp;Parameters<br />
<img id="Codehighlighter1_29_184_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_29_184_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_29_184_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_29_184_Closed_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_29_184_Closed_Image" style="display: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_29_184_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_29_184_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_29_184_Open_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_29_184_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_29_184_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">public</span><span style="color: #000000">&nbsp;Parameters()<br />
<img id="Codehighlighter1_67_124_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_67_124_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_67_124_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_67_124_Closed_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_67_124_Closed_Image" style="display: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_67_124_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_67_124_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_67_124_Open_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_67_124_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_67_124_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Server&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;KeyValue();<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
<img id="Codehighlighter1_164_177_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_164_177_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_164_177_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_164_177_Closed_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_164_177_Closed_Image" style="display: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_164_177_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_164_177_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_164_177_Open_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">public</span><span style="color: #000000">&nbsp;KeyValue&nbsp;Server&nbsp;</span><span id="Codehighlighter1_164_177_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_164_177_Open_Text"><span style="color: #000000">{&nbsp;</span><span style="color: #0000ff">get</span><span style="color: #000000">;&nbsp;</span><span style="color: #0000ff">set</span><span style="color: #000000">;&nbsp;}</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></div>
无奈版：<br />
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #008080">1</span><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">public</span><span style="color: #000000">&nbsp;Parameters()<br />
</span><span style="color: #008080">2</span><span style="color: #000000"><img id="Codehighlighter1_29_224_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_29_224_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_29_224_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_29_224_Closed_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_29_224_Closed_Image" style="display: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_29_224_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_29_224_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_29_224_Open_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_29_224_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_29_224_Open_Text"><span style="color: #000000">{<br />
</span><span style="color: #008080">3</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">foreach</span><span style="color: #000000">&nbsp;(PropertyInfo&nbsp;pi&nbsp;</span><span style="color: #0000ff">in</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">this</span><span style="color: #000000">.GetType().GetProperties())<br />
</span><span style="color: #008080">4</span><span style="color: #000000"><img id="Codehighlighter1_115_214_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_115_214_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_115_214_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_115_214_Closed_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_115_214_Closed_Image" style="display: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_115_214_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_115_214_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_115_214_Open_Text').style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_115_214_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_115_214_Open_Text"><span style="color: #000000">{<br />
</span><span style="color: #008080">5</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pi.SetValue(</span><span style="color: #0000ff">this</span><span style="color: #000000">,&nbsp;Activator.CreateInstance(pi.PropertyType),&nbsp;</span><span style="color: #0000ff">null</span><span style="color: #000000">);<br />
</span><span style="color: #008080">6</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
</span><span style="color: #008080">7</span><span style="color: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></div>
 <img src ="http://www.cnblogs.com/explup/aggbug/1160140.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41938/" target="_blank">[新闻]新学年开始 大学生适用的十大互联网应用</a>]]></description></item><item><title>DataGridView绑定List时无法进行添加删除操作的解决方法</title><link>http://www.cnblogs.com/explup/archive/2008/03/26/1122998.html</link><dc:creator>one</dc:creator><author>one</author><pubDate>Wed, 26 Mar 2008 05:50:00 GMT</pubDate><guid>http://www.cnblogs.com/explup/archive/2008/03/26/1122998.html</guid><wfw:comment>http://www.cnblogs.com/explup/comments/1122998.html</wfw:comment><comments>http://www.cnblogs.com/explup/archive/2008/03/26/1122998.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cnblogs.com/explup/comments/commentRss/1122998.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/explup/services/trackbacks/1122998.html</trackback:ping><description><![CDATA[<p>将List&lt;T&gt;转换为BindingList&lt;T&gt;,然后设置DataGridView的DataSource为BindingList&lt;T&gt;！！<br />
代码：</p>
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #000000">DataGridView.DataSource&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;BindingList</span><span style="color: #000000">&lt;</span><span style="color: #000000">T</span><span style="color: #000000">&gt;</span><span style="color: #000000">(List</span><span style="color: #000000">&lt;</span><span style="color: #000000">T</span><span style="color: #000000">&gt;</span><span style="color: #000000">);</span></div>
<br />
将绑定BindingList&lt;T&gt;的DataSource转化为List&lt;T&gt;,同理<br />
代码：<br />
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #000000">List</span><span style="color: #000000">&lt;</span><span style="color: #000000">T</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;modelList</span><span style="color: #000000">=</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;List</span><span style="color: #000000">&lt;</span><span style="color: #000000">T</span><span style="color: #000000">&gt;</span><span style="color: #000000">((BindingList</span><span style="color: #000000">&lt;</span><span style="color: #000000">T</span><span style="color: #000000">&gt;</span><span style="color: #000000">)</span><span style="color: #0000ff">this</span><span style="color: #000000">.DataGridView.DataSource);</span></div>
<br />
<br />
说明：BindingList&lt;T&gt;和List&lt;T&gt;都有个构造函数，参数是<font face="Verdana">IEnumerable&lt;T&gt;,既然他们俩个都是继承<font face="Verdana">IEnumerable</font>，当然能相互转换。</font><font color="#0000ff" size="4"><font color="#0000ff" size="4"> <br />
</font></font>
<p>下面是这个构造函数的执行过程：<img src="http://www.cnblogs.com/Emoticons/msn/bat.gif"  alt="" /></p>
<font size="4">
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #0000ff">public</span><span style="color: #000000">&nbsp;List(IEnumerable</span><span style="color: #000000">&lt;</span><span style="color: #000000">T</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;collection)<br />
<img id="Codehighlighter1_39_663_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_39_663_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_39_663_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_39_663_Closed_Text').style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_39_663_Closed_Image" style="display: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_39_663_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_39_663_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_39_663_Open_Text').style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" /></span><span id="Codehighlighter1_39_663_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_39_663_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(collection&nbsp;</span><span style="color: #000000">==</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">null</span><span style="color: #000000">)<br />
<img id="Codehighlighter1_73_158_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_73_158_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_73_158_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_73_158_Closed_Text').style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_73_158_Closed_Image" style="display: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_73_158_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_73_158_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_73_158_Open_Text').style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_73_158_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_73_158_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ThrowHelper.ThrowArgumentNullException(ExceptionArgument.collection);<br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;ICollection</span><span style="color: #000000">&lt;</span><span style="color: #000000">T</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;is2&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;collection&nbsp;</span><span style="color: #0000ff">as</span><span style="color: #000000">&nbsp;ICollection</span><span style="color: #000000">&lt;</span><span style="color: #000000">T</span><span style="color: #000000">&gt;</span><span style="color: #000000">;<br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(is2&nbsp;</span><span style="color: #000000">!=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">null</span><span style="color: #000000">)<br />
<img id="Codehighlighter1_239_377_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_239_377_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_239_377_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_239_377_Closed_Text').style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_239_377_Closed_Image" style="display: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_239_377_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_239_377_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_239_377_Open_Text').style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_239_377_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_239_377_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;count&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;is2.Count;<br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">this</span><span style="color: #000000">._items&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;T[count];<br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is2.CopyTo(</span><span style="color: #0000ff">this</span><span style="color: #000000">._items,&nbsp;</span><span style="color: #800080">0</span><span style="color: #000000">);<br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">this</span><span style="color: #000000">._size&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;count;<br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">else</span><span style="color: #000000"><br />
<img id="Codehighlighter1_391_661_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_391_661_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_391_661_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_391_661_Closed_Text').style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_391_661_Closed_Image" style="display: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_391_661_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_391_661_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_391_661_Open_Text').style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_391_661_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_391_661_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">this</span><span style="color: #000000">._size&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #800080">0</span><span style="color: #000000">;<br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">this</span><span style="color: #000000">._items&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;T[</span><span style="color: #800080">4</span><span style="color: #000000">];<br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">using</span><span style="color: #000000">&nbsp;(IEnumerator</span><span style="color: #000000">&lt;</span><span style="color: #000000">T</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;enumerator&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;collection.GetEnumerator())<br />
<img id="Codehighlighter1_528_655_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_528_655_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_528_655_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_528_655_Closed_Text').style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_528_655_Closed_Image" style="display: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_528_655_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_528_655_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_528_655_Open_Text').style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_528_655_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_528_655_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">while</span><span style="color: #000000">&nbsp;(enumerator.MoveNext())<br />
<img id="Codehighlighter1_584_645_Open_Image" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_584_645_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_584_645_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_584_645_Closed_Text').style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_584_645_Closed_Image" style="display: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_584_645_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_584_645_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_584_645_Open_Text').style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_584_645_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_584_645_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">this</span><span style="color: #000000">.Add(enumerator.Current);<br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />}</span></span><span style="color: #000000"><br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
<img src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align="top"  alt="" /></span></div>
</font>
<img src ="http://www.cnblogs.com/explup/aggbug/1122998.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41937/" target="_blank">[新闻]Google拟在9月发布自有浏览器 或采用火狐内核</a>]]></description></item></channel></rss>