當前位置: 首頁>>代碼示例>>C#>>正文


C# Document.Object方法代碼示例

本文整理匯總了C#中System.Windows.Forms.Document.Object方法的典型用法代碼示例。如果您正苦於以下問題:C# Document.Object方法的具體用法?C# Document.Object怎麽用?C# Document.Object使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Forms.Document的用法示例。


在下文中一共展示了Document.Object方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: getDocumentText

        private string getDocumentText(Document document)
        {
            if (document == null) return null;

            var textDocument = (TextDocument)document.Object("TextDocument");
            EditPoint editPoint = textDocument.StartPoint.CreateEditPoint();
            var content = editPoint.GetText(textDocument.EndPoint);
            return content;
        }
開發者ID:stickleprojects,項目名稱:ClassOutline,代碼行數:9,代碼來源:RegionParser.cs

示例2: GetTextDocument

    private TextDocument GetTextDocument(Document doc) {
        if (doc == null || doc.ReadOnly) {
            return null;
        }

        var textDoc = doc.Object("TextDocument") as TextDocument;

        return textDoc;
    }
開發者ID:Squeegee,項目名稱:astyle-extension,代碼行數:9,代碼來源:AStyleExtensionPackage.cs

示例3: DocumentReader

 public DocumentReader(Document document)
 {
     this.document = document;
     TextDocument textDocument = (TextDocument)document.Object("TextDocument");
     EditPoint editPoint = textDocument.StartPoint.CreateEditPoint();
     editPoint.StartOfDocument();
     strDocument = editPoint.GetText(textDocument.EndPoint);
     documentIndex = -1;
     SetTabSize();
 }
開發者ID:jeffdik,項目名稱:tachy,代碼行數:10,代碼來源:DocumentReader.cs

示例4: InsertTemplate

        private void InsertTemplate(Document document, string toInsert)
        {
            var textDocument = document.Object() as TextDocument;

            textDocument.StartPoint.CreateEditPoint();
            textDocument.Selection.Insert(toInsert);
        }
開發者ID:K-Pavlov,項目名稱:TemplatorAddIn,代碼行數:7,代碼來源:TemplateForm.cs

示例5: SelectAllCodeFromDocument

 //Nice clean methods avoiding slow selection-editing, from online post at:
 //  http://www.visualstudiodev.com/visual-studio-extensibility/how-can-i-edit-documents-programatically-22319.shtml
 private static string SelectAllCodeFromDocument(Document targetDoc)
 {
     string outText = "";
     TextDocument textDoc = targetDoc.Object("TextDocument") as TextDocument;
     if (textDoc != null)
         outText = textDoc.StartPoint.CreateEditPoint().GetText(textDoc.EndPoint);
     return outText;
 }
開發者ID:Rock-VbCity,項目名稱:PoorMansTSqlFormatter,代碼行數:10,代碼來源:AddinConnector.cs

示例6: ReplaceAllCodeInDocument

 private static void ReplaceAllCodeInDocument(Document targetDoc, string newText)
 {
     TextDocument textDoc = targetDoc.Object("TextDocument") as TextDocument;
     if (textDoc != null)
     {
         textDoc.StartPoint.CreateEditPoint().Delete(textDoc.EndPoint);
         textDoc.StartPoint.CreateEditPoint().Insert(newText);
     }
 }
開發者ID:Rock-VbCity,項目名稱:PoorMansTSqlFormatter,代碼行數:9,代碼來源:AddinConnector.cs

示例7: ReplaceAllCodeInDocument

 private static void ReplaceAllCodeInDocument(Document targetDoc, string newText)
 {
     TextDocument textDoc = targetDoc.Object("TextDocument") as TextDocument;
     if (textDoc != null)
     {
         textDoc.StartPoint.CreateEditPoint().ReplaceText(textDoc.EndPoint, newText, (int)vsEPReplaceTextOptions.vsEPReplaceTextKeepMarkers);
     }
 }
開發者ID:GetACookie,項目名稱:PoorMansTSqlFormatter,代碼行數:8,代碼來源:PoorMansTSqlFormatterCommand.cs

示例8: GetTextDocument

 public static TextDocument GetTextDocument(Document doc)
 {
     return doc.Object("TextDocument") as TextDocument;
 }
開發者ID:qianlifeng,項目名稱:easyvsx,代碼行數:4,代碼來源:VSDocument.cs


注:本文中的System.Windows.Forms.Document.Object方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。