PadToColumn

  • Thread starter Thread starter AA2e72E
  • Start date Start date
A

AA2e72E

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("TextDocument");
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/library/envdte.textselection.padtocolumn(VS.80).aspx

What is DTE2?
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top