473,395 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

PadToColumn

I was looking into/using PadLeft & PadRight; I came across this code:

public void PadToColumnExample(DTE2 dte)
{
// Create a new text file.
dte.ItemOperations.NewFile(@"General\Text File", "",
Constants.vsViewKindPrimary);

// Create an EditPoint at the start of the new file.
TextDocument doc =

(TextDocument)dte.ActiveDocument.Object("TextDocum ent");
EditPoint point = doc.StartPoint.CreateEditPoint();

// Insert 10 lines of text.
for (int i = 0; i < 10; i++)
point.Insert("This is a test.\n");

point.StartOfDocument();

// Indent text to column 10.
for (int i = 0; i < 10; i++)
{
point.PadToColumn(10);
point.LineDown(1);
point.StartOfLine();
}
}

here:
http://msdn.microsoft.com/ko-kr/libr...mn(VS.80).aspx

What is DTE2?
Sep 24 '08 #1
2 1061
It looks to be part of EnvDTE
http://msdn.microsoft.com/en-us/libr...te(VS.80).aspx

If all you want to do is pad, then you don't need this - the example
given is specific to VS automation.

What is it you want to do?

Marc
Sep 24 '08 #2
Thanks for the pointer Marc.

I am formatting email for SMTPclient as plain text & html; I am using
composite formatting ({0,-m} etc) and string.PadRight(m) etc. for plain text.
I came across PadToColumn and could not figure out what it was doing. Hence
the question: from what you indicate, it is not of any use for the job to
hand.
Sep 24 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.