本文整理汇总了C#中ScintillaNet.GetText方法的典型用法代码示例。如果您正苦于以下问题:C# ScintillaNet.GetText方法的具体用法?C# ScintillaNet.GetText怎么用?C# ScintillaNet.GetText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScintillaNet
的用法示例。
在下文中一共展示了ScintillaNet.GetText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleDotCompletion
/// <summary>
/// Complete object member
/// </summary>
/// <param name="Sci">Scintilla control</param>
/// <param name="autoHide">Don't keep the list open if the word does not match</param>
/// <returns>Auto-completion has been handled</returns>
static private bool HandleDotCompletion(ScintillaNet.ScintillaControl Sci, bool autoHide)
{
// get expression at cursor position
int position = Sci.CurrentPos;
ASExpr expr = GetExpression(Sci, position);
if (expr.Value == null)
return true;
int dotIndex = expr.Value.LastIndexOf('.');
if (dotIndex == 0) return true;
string tail = (dotIndex >= 0) ? expr.Value.Substring(dotIndex+1) : expr.Value;
DebugConsole.Trace("? "+dotIndex+" '"+expr.separator+"' "+expr.Keyword+" ."+tail);
// complete keyword
if (dotIndex < 0)
{
if (expr.Keyword == "new") return HandleNewCompletion(Sci, expr.Value, autoHide);
else if (expr.separator == ':') {
if (HandleColonCompletion(Sci, expr.Value, autoHide)) return true;
}
else if (expr.Keyword == "import")
return HandleImportCompletion(Sci, expr.Value, autoHide);
else if ((expr.Keyword == "extends") || (expr.Keyword == "implements"))
return HandleNewCompletion(Sci, expr.Value, autoHide);
}
else if ((expr.ContextBody == null) && (expr.separator != ':') && (expr.separator != '=')
&& (expr.Keyword != "import") && (expr.Keyword != "extends") && (expr.Keyword != "implements") )
return true;
// complete declaration
if ((expr.ContextBody == null) &&
((expr.separator == ';') || (expr.separator == ' ') || (expr.separator == '}') || (expr.separator == '{')))
{
if (expr.Value.IndexOf('#') >= 0) return true;
else
{
string text = " "+ASClassParser.CleanClassSource(Sci.GetText(Sci.CurrentPos), null)+" ";
if (Regex.IsMatch(text, "[\\s](class|interface)[\\s]"))
{
DebugConsole.Trace("Match class");
Match m = Regex.Match(text, "[\\s](class|interface)[\\s]+"+ASContext.CurrentClass.ClassName+"[\\s{]");
if (m.Success)
{
if (text.Substring(m.Index).IndexOf('{') > 0)
return HandleDeclarationCompletion(Sci, "function private public static var", tail, autoHide);
else if ((expr.Keyword != "extends") && (expr.Keyword != "implements"))
return HandleDeclarationCompletion(Sci, "extends implements", tail, autoHide);
}
else return true;
}
else if (expr.Keyword == "class") return true;
else if (dotIndex < 0) return HandleDeclarationCompletion(Sci, "import", tail, autoHide);
}
}
DebugConsole.Trace("** Complete expression '"+expr.separator+"' "+expr.Value.Length);
DebugConsole.Trace(expr.Value);
// Context
expr.LocalVars = ParseLocalVars(expr);
ASClass cClass = ASContext.CurrentClass;
ASResult result;
ASClass tmpClass;
if (dotIndex > 0)
{
// Expression before cursor
result = EvalExpression(expr.Value, expr, cClass, false);
if (result.IsNull())
return true;
tmpClass = result.Class;
}
else
{
result = new ASResult();
tmpClass = cClass;
}
ASMemberList mix = new ASMemberList();
// local vars are the first thing to try
if ((result.IsNull() || (dotIndex < 0)) && (expr.ContextFunction != null))
mix.Merge(expr.LocalVars);
// packages
if (tmpClass.Package != null)
mix.Merge(tmpClass.Package);
// get all members
FlagType mask = 0;
if ((expr.ContextFunction != null) || (expr.separator != ':'))
{
// user setting may ask to hide some members
bool limitMembers = ASContext.HideIntrinsicMembers || (autoHide && !ASContext.AlwaysShowIntrinsicMembers);
// static or dynamic members?
if (!result.IsNull())
mask = (result.IsStatic) ? FlagType.Static : FlagType.Dynamic;
// show private member of current class only only
//.........这里部分代码省略.........