本文整理汇总了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();
}
示例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;
}
示例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();
}