当前位置: 首页>>代码示例>>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;未经允许,请勿转载。