<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Duplicate line command for Visual Studio</title>
	<atom:link href="http://www.herrodius.com/blog/52/feed" rel="self" type="application/rss+xml" />
	<link>http://www.herrodius.com/blog/52</link>
	<description>Thoughts from a software developer</description>
	<lastBuildDate>Tue, 01 Jun 2010 08:04:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Gary Oak</title>
		<link>http://www.herrodius.com/blog/52/comment-page-1#comment-14257</link>
		<dc:creator>Gary Oak</dc:creator>
		<pubDate>Tue, 02 Feb 2010 02:00:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.herrodius.com/blog/?p=52#comment-14257</guid>
		<description>This didn&#039;t work for me in VS 2008 Pro.</description>
		<content:encoded><![CDATA[<p>This didn&#8217;t work for me in VS 2008 Pro.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JeeZ</title>
		<link>http://www.herrodius.com/blog/52/comment-page-1#comment-13665</link>
		<dc:creator>JeeZ</dc:creator>
		<pubDate>Thu, 25 Sep 2008 16:21:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.herrodius.com/blog/?p=52#comment-13665</guid>
		<description>Hi,
I&#039;m modified the macro so that if multiple line are selected, they are duplicated. If not, only the current line is dupplicated (as before).

Note: The String.Replace function is used to prevent the &quot;Automatic insertion of end constructs&quot; option from being triggered, which would add uneeded additionnal end constructs.

[CODE]
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics

Public Module DuplicateSelectionOrCurrentLineModule
    Sub DuplicateLine()
        Dim line As String
        line = DTE.ActiveDocument.Selection.Text
        If (line.Length = 0) Then
            DTE.ActiveDocument.Selection.StartOfLine(0)
            DTE.ActiveDocument.Selection.EndOfLine(True)
            line = DTE.ActiveDocument.Selection.Text
        End If
        line.Replace(ControlChars.NewLine, ControlChars.NewLine &amp; &quot;&#039;&quot;)
        DTE.ActiveDocument.Selection.EndOfLine()
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.StartOfLine(0)
        DTE.ActiveDocument.Selection.Text = line
    End Sub
End Module
[/CODE]</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I&#8217;m modified the macro so that if multiple line are selected, they are duplicated. If not, only the current line is dupplicated (as before).</p>
<p>Note: The String.Replace function is used to prevent the &#8220;Automatic insertion of end constructs&#8221; option from being triggered, which would add uneeded additionnal end constructs.</p>
<p>[CODE]<br />
Imports System<br />
Imports EnvDTE<br />
Imports EnvDTE80<br />
Imports System.Diagnostics</p>
<p>Public Module DuplicateSelectionOrCurrentLineModule<br />
    Sub DuplicateLine()<br />
        Dim line As String<br />
        line = DTE.ActiveDocument.Selection.Text<br />
        If (line.Length = 0) Then<br />
            DTE.ActiveDocument.Selection.StartOfLine(0)<br />
            DTE.ActiveDocument.Selection.EndOfLine(True)<br />
            line = DTE.ActiveDocument.Selection.Text<br />
        End If<br />
        line.Replace(ControlChars.NewLine, ControlChars.NewLine &amp; &#8220;&#8216;&#8221;)<br />
        DTE.ActiveDocument.Selection.EndOfLine()<br />
        DTE.ActiveDocument.Selection.NewLine()<br />
        DTE.ActiveDocument.Selection.StartOfLine(0)<br />
        DTE.ActiveDocument.Selection.Text = line<br />
    End Sub<br />
End Module<br />
[/CODE]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.herrodius.com/blog/52/comment-page-1#comment-13660</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Sun, 21 Sep 2008 14:55:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.herrodius.com/blog/?p=52#comment-13660</guid>
		<description>Thanks Christophe!  I&#039;ve been missing this from Eclipse... nice to have it back!</description>
		<content:encoded><![CDATA[<p>Thanks Christophe!  I&#8217;ve been missing this from Eclipse&#8230; nice to have it back!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.herrodius.com/blog/52/comment-page-1#comment-13497</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Mon, 12 May 2008 11:18:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.herrodius.com/blog/?p=52#comment-13497</guid>
		<description>Thanks, I&#039;m moving from Linux dev and all the text editors I have ever used have had ctrl+d for duplicate line. I find it hard to believe this functionality was missing from VS2005! Thanks for the macro :D</description>
		<content:encoded><![CDATA[<p>Thanks, I&#8217;m moving from Linux dev and all the text editors I have ever used have had ctrl+d for duplicate line. I find it hard to believe this functionality was missing from VS2005! Thanks for the macro <img src='http://www.herrodius.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: slapout</title>
		<link>http://www.herrodius.com/blog/52/comment-page-1#comment-13489</link>
		<dc:creator>slapout</dc:creator>
		<pubDate>Wed, 07 May 2008 20:30:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.herrodius.com/blog/?p=52#comment-13489</guid>
		<description>Thanks, I&#039;ve been looking for something like this.</description>
		<content:encoded><![CDATA[<p>Thanks, I&#8217;ve been looking for something like this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shaoken</title>
		<link>http://www.herrodius.com/blog/52/comment-page-1#comment-3083</link>
		<dc:creator>Shaoken</dc:creator>
		<pubDate>Mon, 28 Aug 2006 06:39:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.herrodius.com/blog/?p=52#comment-3083</guid>
		<description>Hi Christophe,

If you like this kind of stuff, you definitively must take a look to ReSharper. As you said, &quot;once you get used to it, you can&#039;t live without it&quot;.

http://www.jetbrains.com/resharper/

++ :)</description>
		<content:encoded><![CDATA[<p>Hi Christophe,</p>
<p>If you like this kind of stuff, you definitively must take a look to ReSharper. As you said, &#8220;once you get used to it, you can&#8217;t live without it&#8221;.</p>
<p><a href="http://www.jetbrains.com/resharper/" rel="nofollow">http://www.jetbrains.com/resharper/</a></p>
<p>++ <img src='http://www.herrodius.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
