<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN">
	<id>https://www.ourorangenet.com/wiki/index.php?action=history&amp;feed=atom&amp;title=VisualStudio%E4%B8%ADCSharp%E7%BC%96%E5%86%99%E6%95%88%E7%8E%87%E6%8F%90%E5%8D%87%E5%B0%8F%E6%8F%90%E7%A4%BA</id>
	<title>VisualStudio中CSharp编写效率提升小提示 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://www.ourorangenet.com/wiki/index.php?action=history&amp;feed=atom&amp;title=VisualStudio%E4%B8%ADCSharp%E7%BC%96%E5%86%99%E6%95%88%E7%8E%87%E6%8F%90%E5%8D%87%E5%B0%8F%E6%8F%90%E7%A4%BA"/>
	<link rel="alternate" type="text/html" href="https://www.ourorangenet.com/wiki/index.php?title=VisualStudio%E4%B8%ADCSharp%E7%BC%96%E5%86%99%E6%95%88%E7%8E%87%E6%8F%90%E5%8D%87%E5%B0%8F%E6%8F%90%E7%A4%BA&amp;action=history"/>
	<updated>2026-04-17T09:12:12Z</updated>
	<subtitle>本wiki的该页面的版本历史</subtitle>
	<generator>MediaWiki 1.31.8</generator>
	<entry>
		<id>https://www.ourorangenet.com/wiki/index.php?title=VisualStudio%E4%B8%ADCSharp%E7%BC%96%E5%86%99%E6%95%88%E7%8E%87%E6%8F%90%E5%8D%87%E5%B0%8F%E6%8F%90%E7%A4%BA&amp;diff=332&amp;oldid=prev</id>
		<title>Orange233：/* 正文 */</title>
		<link rel="alternate" type="text/html" href="https://www.ourorangenet.com/wiki/index.php?title=VisualStudio%E4%B8%ADCSharp%E7%BC%96%E5%86%99%E6%95%88%E7%8E%87%E6%8F%90%E5%8D%87%E5%B0%8F%E6%8F%90%E7%A4%BA&amp;diff=332&amp;oldid=prev"/>
		<updated>2021-03-07T17:53:16Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;正文&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2021年3月7日 (日) 17:53的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l18&quot; &gt;第18行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第18行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;如上段代码，第二行比第一行的编写效率更高，这是为什么呢？&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;如上段代码，第二行比第一行的编写效率更高，这是为什么呢？&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;我们先补全一下：a和b都是int类型，而l则是一个List类型。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;先说一下，上文中a和b都是int类型，而l则是一个List类型。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Linq作为一个常用库，很多类都支持对它的扩展，如Count&amp;amp;lt;TResult&amp;amp;gt;&amp;amp;#40;&amp;amp;#41;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;。你可能也知道List自己带有一个Count属性。所以，在图中的第一行代码如果你只写了iend &lt;/del&gt;= videoPlayers.Count &amp;amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;，那么VisualStudio会自动认定这是Count&lt;/del&gt;&amp;amp;lt;TResult&amp;amp;gt;&amp;amp;#40;&amp;amp;#41;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;，之后应该是一个可以作为模板的类型，而不是变量。这时完成列表将不会出现c，因为它是一个变量。这时就要手动输进去c了，缺少了完成列表，这可能会多耗费一点时间。所以在这种情况下，我们可以用&lt;/del&gt;&amp;amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;避开这种情况的发生，这样可以提高效率。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Linq作为一个常用库，很多类都支持对它的扩展，如Count&amp;amp;lt;TResult&amp;amp;gt;&amp;amp;#40;&amp;amp;#41;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;。你可能只是想引用List自己带有一个Count属性，可是（在图中的第一行代码）你只写了iend &lt;/ins&gt;= videoPlayers.Count &amp;amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;，而VisualStudio自动认定这是Count&lt;/ins&gt;&amp;amp;lt;TResult&amp;amp;gt;&amp;amp;#40;&amp;amp;#41;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;，之后应该是一个可以作为模板的类型，而不是变量。这时完成列表将不会出现c，因为它是一个变量。这时就要手动输进去c了，缺少了完成列表，这可能会多耗费一点时间。那么，我们可以用&lt;/ins&gt;&amp;amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;避开这种情况的发生，这样便可以提高效率。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 引用 ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 引用 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;references/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;references/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Orange233</name></author>
		
	</entry>
	<entry>
		<id>https://www.ourorangenet.com/wiki/index.php?title=VisualStudio%E4%B8%ADCSharp%E7%BC%96%E5%86%99%E6%95%88%E7%8E%87%E6%8F%90%E5%8D%87%E5%B0%8F%E6%8F%90%E7%A4%BA&amp;diff=123&amp;oldid=prev</id>
		<title>Root：文本替换 - 替换“&lt;br \&gt;”为“&lt;br /&gt;”</title>
		<link rel="alternate" type="text/html" href="https://www.ourorangenet.com/wiki/index.php?title=VisualStudio%E4%B8%ADCSharp%E7%BC%96%E5%86%99%E6%95%88%E7%8E%87%E6%8F%90%E5%8D%87%E5%B0%8F%E6%8F%90%E7%A4%BA&amp;diff=123&amp;oldid=prev"/>
		<updated>2020-08-16T21:51:55Z</updated>

		<summary type="html">&lt;p&gt;文本替换 - 替换“&amp;lt;br \&amp;gt;”为“&amp;lt;br /&amp;gt;”&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2020年8月16日 (日) 21:51的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot; &gt;第12行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第12行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;a = l.Count &amp;lt; c ? c : l.Count;&amp;lt;br &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;\&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;a = l.Count &amp;lt; c ? c : l.Count;&amp;lt;br &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;/&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;a = c &amp;gt; l.Count ? c : l.Count;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;a = c &amp;gt; l.Count ? c : l.Count;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Root</name></author>
		
	</entry>
	<entry>
		<id>https://www.ourorangenet.com/wiki/index.php?title=VisualStudio%E4%B8%ADCSharp%E7%BC%96%E5%86%99%E6%95%88%E7%8E%87%E6%8F%90%E5%8D%87%E5%B0%8F%E6%8F%90%E7%A4%BA&amp;diff=114&amp;oldid=prev</id>
		<title>2020年8月16日 (日) 21:00 Orange233</title>
		<link rel="alternate" type="text/html" href="https://www.ourorangenet.com/wiki/index.php?title=VisualStudio%E4%B8%ADCSharp%E7%BC%96%E5%86%99%E6%95%88%E7%8E%87%E6%8F%90%E5%8D%87%E5%B0%8F%E6%8F%90%E7%A4%BA&amp;diff=114&amp;oldid=prev"/>
		<updated>2020-08-16T21:00:36Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2020年8月16日 (日) 21:00的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l20&quot; &gt;第20行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第20行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;我们先补全一下：a和b都是int类型，而l则是一个List类型。&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;我们先补全一下：a和b都是int类型，而l则是一个List类型。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Linq作为一个常用库，很多类都支持对它的扩展，如Count&amp;amp;lt;TResult&amp;amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;()&lt;/del&gt;。你可能也知道List自己带有一个Count属性。所以，在图中的第一行代码如果你只写了iend = videoPlayers.Count &amp;amp;lt;，那么VisualStudio会自动认定这是Count&amp;amp;lt;TResult&amp;amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;()&lt;/del&gt;，之后应该是一个可以作为模板的类型，而不是变量。这时完成列表将不会出现c，因为它是一个变量。这时就要手动输进去c了，缺少了完成列表，这可能会多耗费一点时间。所以在这种情况下，我们可以用&amp;amp;gt;避开这种情况的发生，这样可以提高效率。&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Linq作为一个常用库，很多类都支持对它的扩展，如Count&amp;amp;lt;TResult&amp;amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;#40;&amp;amp;#41;&lt;/ins&gt;。你可能也知道List自己带有一个Count属性。所以，在图中的第一行代码如果你只写了iend = videoPlayers.Count &amp;amp;lt;，那么VisualStudio会自动认定这是Count&amp;amp;lt;TResult&amp;amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;#40;&amp;amp;#41;&lt;/ins&gt;，之后应该是一个可以作为模板的类型，而不是变量。这时完成列表将不会出现c，因为它是一个变量。这时就要手动输进去c了，缺少了完成列表，这可能会多耗费一点时间。所以在这种情况下，我们可以用&amp;amp;gt;避开这种情况的发生，这样可以提高效率。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 引用 ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 引用 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;references/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;references/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Orange233</name></author>
		
	</entry>
	<entry>
		<id>https://www.ourorangenet.com/wiki/index.php?title=VisualStudio%E4%B8%ADCSharp%E7%BC%96%E5%86%99%E6%95%88%E7%8E%87%E6%8F%90%E5%8D%87%E5%B0%8F%E6%8F%90%E7%A4%BA&amp;diff=113&amp;oldid=prev</id>
		<title>Orange233：创建页面，内容为“返回 Orange233  == VisualStudio中CSharp编写效率提升小提示 ==  === 类似的问题 ===  Visual Studio 2017 Lost WPF Template  === 正…”</title>
		<link rel="alternate" type="text/html" href="https://www.ourorangenet.com/wiki/index.php?title=VisualStudio%E4%B8%ADCSharp%E7%BC%96%E5%86%99%E6%95%88%E7%8E%87%E6%8F%90%E5%8D%87%E5%B0%8F%E6%8F%90%E7%A4%BA&amp;diff=113&amp;oldid=prev"/>
		<updated>2020-08-16T20:58:30Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“&lt;a href=&quot;/wiki/index.php/%E7%94%A8%E6%88%B7:Orange233&quot; title=&quot;用户:Orange233&quot;&gt;返回 Orange233&lt;/a&gt;  == VisualStudio中CSharp编写效率提升小提示 ==  === 类似的问题 ===  Visual Studio 2017 Lost WPF Template  === 正…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[用户:Orange233|返回 Orange233]]&lt;br /&gt;
&lt;br /&gt;
== VisualStudio中CSharp编写效率提升小提示 ==&lt;br /&gt;
&lt;br /&gt;
=== 类似的问题 ===&lt;br /&gt;
&lt;br /&gt;
Visual Studio 2017 Lost WPF Template&lt;br /&gt;
&lt;br /&gt;
=== 正文 ===&lt;br /&gt;
&lt;br /&gt;
有的时候，用&amp;amp;gt;会更好，除非为了某种特殊的可读性。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
a = l.Count &amp;lt; c ? c : l.Count;&amp;lt;br \&amp;gt;&lt;br /&gt;
a = c &amp;gt; l.Count ? c : l.Count;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
如上段代码，第二行比第一行的编写效率更高，这是为什么呢？&lt;br /&gt;
&lt;br /&gt;
我们先补全一下：a和b都是int类型，而l则是一个List类型。&lt;br /&gt;
&lt;br /&gt;
Linq作为一个常用库，很多类都支持对它的扩展，如Count&amp;amp;lt;TResult&amp;amp;gt;()。你可能也知道List自己带有一个Count属性。所以，在图中的第一行代码如果你只写了iend = videoPlayers.Count &amp;amp;lt;，那么VisualStudio会自动认定这是Count&amp;amp;lt;TResult&amp;amp;gt;()，之后应该是一个可以作为模板的类型，而不是变量。这时完成列表将不会出现c，因为它是一个变量。这时就要手动输进去c了，缺少了完成列表，这可能会多耗费一点时间。所以在这种情况下，我们可以用&amp;amp;gt;避开这种情况的发生，这样可以提高效率。&lt;br /&gt;
&lt;br /&gt;
== 引用 ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Orange233</name></author>
		
	</entry>
</feed><script type="text/javascript">document.write(unescape("%3Cspan id='cnzz_stat_icon_1279967369'%3E%3C/span%3E%3Cscript src='https://s9.cnzz.com/z_stat.php%3Fid%3D1279967369%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));</script>