本文整理汇总了C#中ASCompletion.Completion.FoundDeclaration类的典型用法代码示例。如果您正苦于以下问题:C# FoundDeclaration类的具体用法?C# FoundDeclaration怎么用?C# FoundDeclaration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FoundDeclaration类属于ASCompletion.Completion命名空间,在下文中一共展示了FoundDeclaration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ShowEventsListSetup
public void ShowEventsListSetup()
{
ASContext.Context.SetAs3Features();
ASContext.Context.CurrentModel.Returns(new FileModel());
dataEventModel = CreateDataEventModel();
found = new FoundDeclaration
{
inClass = new ClassModel(),
member = new MemberModel()
};
}
开发者ID:xeronith,项目名称:flashdevelop,代码行数:11,代码来源:ASGeneratorTests.cs
示例2: ShowAddInterfaceDefList
private static void ShowAddInterfaceDefList(FoundDeclaration found, List<string> interfaces)
{
if (GetLangIsValid())
{
List<ICompletionListItem> known = new List<ICompletionListItem>();
string labelClass = TextHelper.GetString("ASCompletion.Label.AddInterfaceDef");
foreach (String interf in interfaces)
{
known.Add(new GeneratorItem(String.Format(labelClass, interf), GeneratorJobType.AddInterfaceDef, found.member, found.inClass, interf));
}
CompletionList.Show(known, false);
}
}
开发者ID:zaynyatyi,项目名称:flashdevelop,代码行数:14,代码来源:ASGenerator.cs
示例3: ShowEventList
private static void ShowEventList(FoundDeclaration found)
{
List<ICompletionListItem> known = new List<ICompletionListItem>();
string tmp = TextHelper.GetString("ASCompletion.Label.GenerateHandler");
string labelEvent = String.Format(tmp, "Event");
string labelDataEvent = String.Format(tmp, "DataEvent");
string labelContext = String.Format(tmp, contextParam);
string[] choices = (contextParam != "Event") ?
new string[] { labelContext, labelEvent } :
new string[] { labelEvent, labelDataEvent };
for (int i = 0; i < choices.Length; i++)
{
known.Add(new GeneratorItem(choices[i],
choices[i] == labelContext ? GeneratorJobType.ComplexEvent : GeneratorJobType.BasicEvent,
found.member, found.inClass));
}
CompletionList.Show(known, false);
}
开发者ID:zaynyatyi,项目名称:flashdevelop,代码行数:18,代码来源:ASGenerator.cs
示例4: ShowNewClassList
private static void ShowNewClassList(FoundDeclaration found)
{
if (GetLangIsValid())
{
List<ICompletionListItem> known = new List<ICompletionListItem>();
string labelClass = TextHelper.GetString("ASCompletion.Label.GenerateClass");
known.Add(new GeneratorItem(labelClass, GeneratorJobType.Class, found.member, found.inClass));
CompletionList.Show(known, false);
}
}
开发者ID:zaynyatyi,项目名称:flashdevelop,代码行数:12,代码来源:ASGenerator.cs
示例5: ShowEventMetatagList
private static void ShowEventMetatagList(FoundDeclaration found)
{
List<ICompletionListItem> known = new List<ICompletionListItem>();
string label = TextHelper.GetString("ASCompletion.Label.GenerateEventMetatag");
known.Add(new GeneratorItem(label, GeneratorJobType.EventMetatag, found.member, found.inClass));
CompletionList.Show(known, false);
}
开发者ID:zaynyatyi,项目名称:flashdevelop,代码行数:9,代码来源:ASGenerator.cs
示例6: ShowImplementInterface
private static void ShowImplementInterface(FoundDeclaration found)
{
List<ICompletionListItem> known = new List<ICompletionListItem>();
string label = TextHelper.GetString("ASCompletion.Label.ImplementInterface");
known.Add(new GeneratorItem(label, GeneratorJobType.ImplementInterface, null, found.inClass));
CompletionList.Show(known, false);
}
开发者ID:zaynyatyi,项目名称:flashdevelop,代码行数:7,代码来源:ASGenerator.cs
示例7: ShowChangeConstructorDeclList
private static void ShowChangeConstructorDeclList(FoundDeclaration found)
{
List<ICompletionListItem> known = new List<ICompletionListItem>();
string label = TextHelper.GetString("ASCompletion.Label.ChangeConstructorDecl");
known.Add(new GeneratorItem(label, GeneratorJobType.ChangeConstructorDecl, found.member, found.inClass));
CompletionList.Show(known, false);
}
开发者ID:zaynyatyi,项目名称:flashdevelop,代码行数:7,代码来源:ASGenerator.cs
示例8: ShowGetSetList
private static void ShowGetSetList(FoundDeclaration found)
{
List<ICompletionListItem> known = new List<ICompletionListItem>();
string labelGetSet = TextHelper.GetString("ASCompletion.Label.GenerateGetSet");
string labelGet = TextHelper.GetString("ASCompletion.Label.GenerateGet");
string labelSet = TextHelper.GetString("ASCompletion.Label.GenerateSet");
string[] choices = new string[] { labelGetSet, labelGet, labelSet };
for (int i = 0; i < choices.Length; i++)
{
known.Add(new GeneratorItem(choices[i], (GeneratorJobType)i, found.member, found.inClass));
}
CompletionList.Show(known, false);
}
开发者ID:heon21st,项目名称:flashdevelop,代码行数:13,代码来源:ASGenerator.cs
示例9: ShowImplementInterface
private static void ShowImplementInterface(FoundDeclaration found, List<ICompletionListItem> options)
{
string label = TextHelper.GetString("ASCompletion.Label.ImplementInterface");
options.Add(new GeneratorItem(label, GeneratorJobType.ImplementInterface, null, found.inClass));
}
开发者ID:JoeRobich,项目名称:flashdevelop,代码行数:5,代码来源:ASGenerator.cs
示例10: ShowEventMetatagList
private static void ShowEventMetatagList(FoundDeclaration found)
{
ContextFeatures features = ASContext.Context.Features;
List<ICompletionListItem> known = new List<ICompletionListItem>();
ScintillaNet.ScintillaControl Sci = ASContext.CurSciControl;
string label = TextHelper.GetString("ASCompletion.Label.GenerateEventMetatag");
known.Add(new GeneratorItem(label, GeneratorJobType.EventMetatag, found.member, found.inClass));
CompletionList.Show(known, false);
}
开发者ID:heon21st,项目名称:flashdevelop,代码行数:12,代码来源:ASGenerator.cs
示例11: ShowAddInterfaceDefList
private static void ShowAddInterfaceDefList(FoundDeclaration found)
{
ContextFeatures features = ASContext.Context.Features;
List<ICompletionListItem> known = new List<ICompletionListItem>();
ScintillaNet.ScintillaControl Sci = ASContext.CurSciControl;
if (PluginBase.CurrentProject != null && PluginBase.CurrentProject.Language.StartsWith("as"))
{
string labelClass = TextHelper.GetString("ASCompletion.Label.AddInterfaceDef");
known.Add(new GeneratorItem(labelClass, GeneratorJobType.AddInterfaceDef, found.member, found.inClass));
CompletionList.Show(known, false);
}
}
开发者ID:heon21st,项目名称:flashdevelop,代码行数:15,代码来源:ASGenerator.cs
示例12: ShowConstructorAndToStringList
private static void ShowConstructorAndToStringList(FoundDeclaration found, bool hasConstructor, bool hasToString)
{
ContextFeatures features = ASContext.Context.Features;
List<ICompletionListItem> known = new List<ICompletionListItem>();
ScintillaNet.ScintillaControl Sci = ASContext.CurSciControl;
if (PluginBase.CurrentProject != null && PluginBase.CurrentProject.Language.StartsWith("as"))
{
if (!hasConstructor)
{
string labelClass = TextHelper.GetString("ASCompletion.Label.GenerateConstructor");
known.Add(new GeneratorItem(labelClass, GeneratorJobType.Constructor, found.member, found.inClass));
}
if (!hasToString)
{
string labelClass = TextHelper.GetString("ASCompletion.Label.GenerateToString");
known.Add(new GeneratorItem(labelClass, GeneratorJobType.ToString, found.member, found.inClass));
}
CompletionList.Show(known, false);
}
}
开发者ID:heon21st,项目名称:flashdevelop,代码行数:24,代码来源:ASGenerator.cs
示例13: ShowNewMethodList
private static void ShowNewMethodList(FoundDeclaration found)
{
ContextFeatures features = ASContext.Context.Features;
List<ICompletionListItem> known = new List<ICompletionListItem>();
ScintillaNet.ScintillaControl Sci = ASContext.CurSciControl;
string autoSelect = "";
ASResult result = ASComplete.GetExpressionType(Sci, Sci.WordEndPosition(Sci.CurrentPos, true));
if (!(result != null && result.relClass != null))
{
result = null;
}
else if (found.inClass.QualifiedName.Equals(result.relClass.QualifiedName))
{
result = null;
}
ClassModel inClass = result != null ? result.relClass : found.inClass;
bool isInterface = ClassIsInterface(inClass);
if (!isInterface)
{
if (result == null)
{
string label = TextHelper.GetString("ASCompletion.Label.GeneratePrivateFunction");
known.Add(new GeneratorItem(label, GeneratorJobType.Function, found.member, found.inClass));
}
}
string labelFunPublic = TextHelper.GetString("ASCompletion.Label.GenerateFunctionPublic");
if (isInterface)
{
labelFunPublic = TextHelper.GetString("ASCompletion.Label.GenerateFunctionInterface");
autoSelect = labelFunPublic;
}
known.Add(new GeneratorItem(labelFunPublic, GeneratorJobType.FunctionPublic, found.member, found.inClass));
CompletionList.Show(known, false);
}
开发者ID:heon21st,项目名称:flashdevelop,代码行数:41,代码来源:ASGenerator.cs
示例14: ShowNewVarList
private static void ShowNewVarList(FoundDeclaration found)
{
ContextFeatures features = ASContext.Context.Features;
List<ICompletionListItem> known = new List<ICompletionListItem>();
ScintillaNet.ScintillaControl Sci = ASContext.CurSciControl;
string autoSelect = "";
ASResult result = ASComplete.GetExpressionType(Sci, Sci.WordEndPosition(Sci.CurrentPos, true));
if (!(result != null && result.relClass != null))
{
result = null;
}
else if (found.inClass.QualifiedName.Equals(result.relClass.QualifiedName))
{
result = null;
}
bool isConst = false;
string textAtCursor = Sci.GetWordFromPosition(Sci.CurrentPos);
if (textAtCursor != null && textAtCursor.ToUpper().Equals(textAtCursor))
{
isConst = true;
}
ClassModel inClass = result != null ? result.relClass : found.inClass;
bool isInterface = ClassIsInterface(inClass);
if (!isInterface)
{
if (isConst)
{
string labelConst = TextHelper.GetString("ASCompletion.Label.GenerateConstant");
known.Add(new GeneratorItem(labelConst, GeneratorJobType.Constant, found.member, found.inClass));
autoSelect = labelConst;
}
if (result == null)
{
string labelVar = TextHelper.GetString("ASCompletion.Label.GeneratePrivateVar");
known.Add(new GeneratorItem(labelVar, GeneratorJobType.Variable, found.member, found.inClass));
}
string labelVarPublic = TextHelper.GetString("ASCompletion.Label.GeneratePublicVar");
known.Add(new GeneratorItem(labelVarPublic, GeneratorJobType.VariablePublic, found.member, found.inClass));
if (result == null)
{
string labelFun = TextHelper.GetString("ASCompletion.Label.GeneratePrivateFunction");
known.Add(new GeneratorItem(labelFun, GeneratorJobType.Function, found.member, found.inClass));
}
}
string labelFunPublic = TextHelper.GetString("ASCompletion.Label.GenerateFunctionPublic");
if (isInterface)
{
labelFunPublic = TextHelper.GetString("ASCompletion.Label.GenerateFunctionInterface");
autoSelect = labelFunPublic;
}
known.Add(new GeneratorItem(labelFunPublic, GeneratorJobType.FunctionPublic, found.member, found.inClass));
if (PluginBase.CurrentProject != null && PluginBase.CurrentProject.Language.StartsWith("as"))
{
string labelClass = TextHelper.GetString("ASCompletion.Label.GenerateClass");
known.Add(new GeneratorItem(labelClass, GeneratorJobType.Class, found.member, found.inClass));
}
CompletionList.Show(known, false);
}
开发者ID:heon21st,项目名称:flashdevelop,代码行数:70,代码来源:ASGenerator.cs
示例15: CheckAutoImport
private static bool CheckAutoImport(FoundDeclaration found)
{
MemberList allClasses = ASContext.Context.GetAllProjectClasses();
if (allClasses != null)
{
List<string> names = new List<string>();
List<MemberModel> matches = new List<MemberModel>();
string dotToken = "." + contextToken;
foreach (MemberModel member in allClasses)
if (member.Name.EndsWith(dotToken) && !names.Contains(member.Name))
{
matches.Add(member);
names.Add(member.Name);
}
if (matches.Count > 0)
{
ShowImportClass(matches);
return true;
}
}
return false;
}
开发者ID:zaynyatyi,项目名称:flashdevelop,代码行数:22,代码来源:ASGenerator.cs
示例16: ShowChangeConstructorDeclList
private static void ShowChangeConstructorDeclList(FoundDeclaration found, List<ICompletionListItem> options)
{
string label = TextHelper.GetString("ASCompletion.Label.ChangeConstructorDecl");
options.Add(new GeneratorItem(label, GeneratorJobType.ChangeConstructorDecl, found.member, found.inClass));
}
开发者ID:JoeRobich,项目名称:flashdevelop,代码行数:5,代码来源:ASGenerator.cs
示例17: ShowPromoteLocalAndAddParameter
private static void ShowPromoteLocalAndAddParameter(FoundDeclaration found)
{
List<ICompletionListItem> known = new List<ICompletionListItem>();
string label = TextHelper.GetString("ASCompletion.Label.PromoteLocal");
string labelMove = TextHelper.GetString("ASCompletion.Label.MoveDeclarationOnTop");
string labelParam = TextHelper.GetString("ASCompletion.Label.AddAsParameter");
known.Add(new GeneratorItem(label, GeneratorJobType.PromoteLocal, found.member, found.inClass));
known.Add(new GeneratorItem(labelMove, GeneratorJobType.MoveLocalUp, found.member, found.inClass));
known.Add(new GeneratorItem(labelParam, GeneratorJobType.AddAsParameter, found.member, found.inClass));
CompletionList.Show(known, false);
}
开发者ID:zaynyatyi,项目名称:flashdevelop,代码行数:11,代码来源:ASGenerator.cs
示例18: ShowNewMethodList
private static void ShowNewMethodList(FoundDeclaration found, List<ICompletionListItem> options)
{
ScintillaControl sci = ASContext.CurSciControl;
ASResult result = ASComplete.GetExpressionType(sci, sci.WordEndPosition(sci.CurrentPos, true));
if (result == null || result.RelClass == null || found.inClass.QualifiedName.Equals(result.RelClass.QualifiedName))
result = null;
string label;
ClassModel inClass = result != null ? result.RelClass : found.inClass;
bool isInterface = (inClass.Flags & FlagType.Interface) > 0;
if (!isInterface && result == null)
{
if (GetDefaultVisibility(found.inClass) == Visibility.Protected)
label = TextHelper.GetString("ASCompletion.Label.GenerateProtectedFunction");
else label = TextHelper.GetString("ASCompletion.Label.GeneratePrivateFunction");
options.Add(new GeneratorItem(label, GeneratorJobType.Function, found.member, found.inClass));
}
if (isInterface) label = TextHelper.GetString("ASCompletion.Label.GenerateFunctionInterface");
else label = TextHelper.GetString("ASCompletion.Label.GenerateFunctionPublic");
options.Add(new GeneratorItem(label, GeneratorJobType.FunctionPublic, found.member, found.inClass));
label = TextHelper.GetString("ASCompletion.Label.GeneratePublicCallback");
options.Add(new GeneratorItem(label, GeneratorJobType.VariablePublic, found.member, found.inClass));
}
开发者ID:JoeRobich,项目名称:flashdevelop,代码行数:22,代码来源:ASGenerator.cs
示例19: ShowNewVarList
private static void ShowNewVarList(FoundDeclaration found)
{
bool generateClass = GetLangIsValid();
ScintillaNet.ScintillaControl Sci = ASContext.CurSciControl;
int currentPos = Sci.CurrentPos;
ASResult exprAtCursor = ASComplete.GetExpressionType(Sci, Sci.WordEndPosition(currentPos, true));
if (exprAtCursor == null || exprAtCursor.InClass == null || found.inClass.QualifiedName.Equals(exprAtCursor.RelClass.QualifiedName))
exprAtCursor = null;
ASResult exprLeft = null;
int curWordStartPos = Sci.WordStartPosition(currentPos, true);
if ((char)Sci.CharAt(curWordStartPos - 1) == '.') exprLeft = ASComplete.GetExpressionType(Sci, curWordStartPos - 1);
if (exprLeft != null && exprLeft.Type == null) exprLeft = null;
if (exprLeft != null)
{
if (exprLeft.Type.InFile != null && !File.Exists(exprLeft.Type.InFile.FileName)) return;
generateClass = false;
ClassModel curClass = ASContext.Context.CurrentClass;
if (!isHaxe)
{
if (exprLeft.Type.Equals(curClass)) exprLeft = null;
}
else
{
while (!curClass.IsVoid())
{
if (curClass.Equals(exprLeft.Type))
{
exprLeft = null;
break;
}
curClass.ResolveExtends();
curClass = curClass.Extends;
}
}
}
List<ICompletionListItem> known = new List<ICompletionListItem>();
string label;
if ((exprAtCursor != null && exprAtCursor.RelClass != null && (exprAtCursor.RelClass.Flags & FlagType.Interface) > 0)
|| (found.inClass != null && (found.inClass.Flags & FlagType.Interface) > 0))
{
label = TextHelper.GetString("ASCompletion.Label.GenerateFunctionInterface");
known.Add(new GeneratorItem(label, GeneratorJobType.FunctionPublic, found.member, found.inClass));
}
else
{
string textAtCursor = Sci.GetWordFromPosition(currentPos);
bool isConst = textAtCursor != null && textAtCursor.ToUpper().Equals(textAtCursor);
if (isConst)
{
label = TextHelper.GetString("ASCompletion.Label.GenerateConstant");
known.Add(new GeneratorItem(label, GeneratorJobType.Constant, found.member, found.inClass));
}
bool genProtectedDecl = ASContext.Context.Features.protectedKey != null && ASContext.CommonSettings.GenerateProtectedDeclarations;
if (exprAtCursor == null && exprLeft == null)
{
if (genProtectedDecl) label = TextHelper.GetString("ASCompletion.Label.GenerateProtectedVar");
else label = TextHelper.GetString("ASCompletion.Label.GeneratePrivateVar");
known.Add(new GeneratorItem(label, GeneratorJobType.Variable, found.member, found.inClass));
}
label = TextHelper.GetString("ASCompletion.Label.GeneratePublicVar");
known.Add(new GeneratorItem(label, GeneratorJobType.VariablePublic, found.member, found.inClass));
if (exprAtCursor == null && exprLeft == null)
{
if (genProtectedDecl) label = TextHelper.GetString("ASCompletion.Label.GenerateProtectedFunction");
else label = TextHelper.GetString("ASCompletion.Label.GeneratePrivateFunction");
known.Add(new GeneratorItem(label, GeneratorJobType.Function, found.member, found.inClass));
}
label = TextHelper.GetString("ASCompletion.Label.GenerateFunctionPublic");
known.Add(new GeneratorItem(label, GeneratorJobType.FunctionPublic, found.member, found.inClass));
if (generateClass)
{
label = TextHelper.GetString("ASCompletion.Label.GenerateClass");
known.Add(new GeneratorItem(label, GeneratorJobType.Class, found.member, found.inClass));
}
}
CompletionList.Show(known, false);
}
开发者ID:zaynyatyi,项目名称:flashdevelop,代码行数:82,代码来源:ASGenerator.cs
示例20: ShowNewClassList
private static void ShowNewClassList(FoundDeclaration found, List<ICompletionListItem> options)
{
if (GetLangIsValid())
{
string labelClass = TextHelper.GetString("ASCompletion.Label.GenerateClass");
options.Add(new GeneratorItem(labelClass, GeneratorJobType.Class, found.member, found.inClass));
}
}
开发者ID:JoeRobich,项目名称:flashdevelop,代码行数:8,代码来源:ASGenerator.cs
注:本文中的ASCompletion.Completion.FoundDeclaration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论