PadToColumn

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?QUEyZTcyRQ==?=

    #1

    PadToColumn

    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?
  • Marc Gravell

    #2
    Re: PadToColumn

    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

    Comment

    • =?Utf-8?B?QUEyZTcyRQ==?=

      #3
      Re: PadToColumn

      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.

      Comment

      Working...