I was looking into/using PadLeft & PadRight; I came across this code:
public void PadToColumnExam ple(DTE2 dte)
{
// Create a new text file.
dte.ItemOperati ons.NewFile(@"G eneral\Text File", "",
Constants.vsVie wKindPrimary);
// Create an EditPoint at the start of the new file.
TextDocument doc =
(TextDocument)d te.ActiveDocume nt.Object("Text Document");
EditPoint point = doc.StartPoint. CreateEditPoint ();
// Insert 10 lines of text.
for (int i = 0; i < 10; i++)
point.Insert("T his is a test.\n");
point.StartOfDo cument();
// Indent text to column 10.
for (int i = 0; i < 10; i++)
{
point.PadToColu mn(10);
point.LineDown( 1);
point.StartOfLi ne();
}
}
here:
http://msdn.microsoft.com/ko-kr/libr...mn(VS.80).aspx
What is DTE2?
public void PadToColumnExam ple(DTE2 dte)
{
// Create a new text file.
dte.ItemOperati ons.NewFile(@"G eneral\Text File", "",
Constants.vsVie wKindPrimary);
// Create an EditPoint at the start of the new file.
TextDocument doc =
(TextDocument)d te.ActiveDocume nt.Object("Text Document");
EditPoint point = doc.StartPoint. CreateEditPoint ();
// Insert 10 lines of text.
for (int i = 0; i < 10; i++)
point.Insert("T his is a test.\n");
point.StartOfDo cument();
// Indent text to column 10.
for (int i = 0; i < 10; i++)
{
point.PadToColu mn(10);
point.LineDown( 1);
point.StartOfLi ne();
}
}
here:
http://msdn.microsoft.com/ko-kr/libr...mn(VS.80).aspx
What is DTE2?
Comment