当前位置: 首页>>代码示例>>C#>>正文


C# TextArea.get_Text方法代码示例

本文整理汇总了C#中ICSharpCode.TextEditor.TextArea.get_Text方法的典型用法代码示例。如果您正苦于以下问题:C# TextArea.get_Text方法的具体用法?C# TextArea.get_Text怎么用?C# TextArea.get_Text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICSharpCode.TextEditor.TextArea的用法示例。


在下文中一共展示了TextArea.get_Text方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GenerateCompletionData

        public ICompletionData[] GenerateCompletionData(string fileName, TextArea textArea, char charTyped)
        {
            // We can return code-completion items like this:
            
            //return new ICompletionData[] {
            //	new DefaultCompletionData("Text", "Description", 1)
            //};
            string targetText;
            if (CodeCompleteCaretLocationOffset.Line == 0)
            {

                targetText = textArea.get_Text(); // textArea.MotherTextEditorControl.Text;                
            }
            else
            {
                var firstMethodOffset = calculateFirstMethodOffset();
                targetText = getAdjustedSnippetText(textArea, firstMethodOffset);
            }

            var resolver = new NRefactoryResolver(myProjectContent.Language);
            //ResolveResult rr = resolver.Resolve(FindExpression(textArea),
            var rr = resolver.Resolve(currentExpression, parseInformation, targetText);
            var resultList = new List<ICompletionData>();
            if (rr.notNull())// && ) 
            {                
                ArrayList completionData = rr.GetCompletionData(this.myProjectContent);
                /*"[CodeComplete] expression '{0}' was resolved into type: {1} with {2} results".info(currentExpression.Expression, 
                                                                                                    rr.ResolvedType.FullyQualifiedName,
                                                                                                    completionData.isNull() ? -1 
                                                                                                                            : completionData.Count);*/
                "[CodeComplete] expression '{0}' was resolved into: {1} with {2} results".info(currentExpression.Expression,
                                                                                               rr.ResolvedType.notNull() 
                                                                                                    ? rr.ResolvedType.FullyQualifiedName
                                                                                                    : rr.prop("Name").str(),
                                                                                               completionData.isNull() 
                                                                                                    ? -1 
                                                                                                    : completionData.Count);
                if (completionData != null) {
                    AddCompletionData(resultList, completionData);
                }
            }
            else
                "[CodeComplete] expression '{0}' could not be resolved".error(currentExpression.Expression);
           // "In generate completion Data, There were {0} results found".format(resultList.Count).debug();
            return resultList.ToArray();
        }        
开发者ID:modulexcite,项目名称:FluentSharp_Fork.SharpDevelopEditor,代码行数:46,代码来源:O2CodeCompletion.cs

示例2: getAdjustedSnippetText

 public string getAdjustedSnippetText(TextArea textArea, int firstMethodOffset)
 {            
     var currentText = textArea.get_Text(); ;           
     var size = CodeCompleteTargetText.size();
     if (firstMethodOffset < size)
     {
         var adjustedSnippeetText = CodeCompleteTargetText.Substring(0, firstMethodOffset);
         adjustedSnippeetText += currentText.line();
         adjustedSnippeetText += "\t}".line() +
                                   "}".line();
         return adjustedSnippeetText;
     }
     return currentText;
 }
开发者ID:modulexcite,项目名称:FluentSharp_Fork.SharpDevelopEditor,代码行数:14,代码来源:O2CodeCompletion.cs

示例3: GenerateCompletionData

        public ICompletionData[] GenerateCompletionData(string fileName, TextArea textArea, char charTyped)
        {
            // We can return code-completion items like this:

            //return new ICompletionData[] {
            //	new DefaultCompletionData("Text", "Description", 1)
            //};
            var targetText = "";
            if (CodeCompleteCaretLocationOffset.Line == 0)
            {

                targetText = textArea.get_Text(); // textArea.MotherTextEditorControl.Text;
            }
            else
            {
                var firstMethodOffset = calculateFirstMethodOffset();
                targetText = getAdjustedSnippetText(textArea, firstMethodOffset);
            }

            NRefactoryResolver resolver = new NRefactoryResolver(this.myProjectContent.Language);
            //ResolveResult rr = resolver.Resolve(FindExpression(textArea),
            ResolveResult rr = resolver.Resolve(currentExpression,
                                                    this.parseInformation,
                                                    targetText);
            List<ICompletionData> resultList = new List<ICompletionData>();
            if (rr != null) {
                ArrayList completionData = rr.GetCompletionData(this.myProjectContent);
                if (completionData != null) {
                    AddCompletionData(resultList, completionData);
                }
            }
               // "In generate completion Data, There were {0} results found".format(resultList.Count).debug();
            return resultList.ToArray();
        }
开发者ID:pusp,项目名称:o2platform,代码行数:34,代码来源:O2CodeCompletion.cs


注:本文中的ICSharpCode.TextEditor.TextArea.get_Text方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。