本文整理汇总了C#中MemberList.AddList方法的典型用法代码示例。如果您正苦于以下问题:C# MemberList.AddList方法的具体用法?C# MemberList.AddList怎么用?C# MemberList.AddList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemberList
的用法示例。
在下文中一共展示了MemberList.AddList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddReleventKeywords
public override void AddReleventKeywords(MemberList memberList, Node node, Scope scope, int identifierContext) {
if (memberList == null) return;
if (node is AttributeNode ){
LanguageService.AddAttributeContextKeywords(memberList);
return;
}
if (node is TypeAlias) {
memberList.AddList(LanguageService.GetNamespaceStartKeywords());
return;
}
Construct cons = node as Construct;
if (cons != null){
Member lastMember = memberList.Count > 0 ? memberList[memberList.Count - 1] : null;
memberList.RemoveAt(memberList.Count - 1);
if (!(cons.Constructor is QualifiedIdentifier)) {
lastMember = LanguageService.AddTypeKeywords(memberList, lastMember as TypeNode);
}
if(lastMember!= null) memberList.Add(lastMember);
return;
}
Identifier id = node as Identifier;
if (id != null) {
bool lastMemberPresent = memberList.Count > 0;
Member lastMember = memberList.Count > 0 ? memberList[memberList.Count - 1] : null;
memberList.RemoveAt(memberList.Count - 1);
lastMember = LanguageService.AddTypeKeywords(memberList, lastMember as TypeNode);
if (lastMemberPresent) memberList.Add(lastMember);
return;
}
TypeExpression tExpr = node as TypeExpression;
if (tExpr != null && !(tExpr.Expression is QualifiedIdentifier)) {
LanguageService.AddTypeKeywords(memberList, null);
return;
}
if (node is NameBinding) {
if (identifierContext == IdentifierContexts.ParameterContext)
LanguageService.AddParameterContextKeywords(memberList);
else if (scope is NamespaceScope || scope is TypeScope) {
if (identifierContext == IdentifierContexts.TypeContext)
LanguageService.AddTypeKeywords(memberList, null);
else if(identifierContext != IdentifierContexts.EventContext)
this.AddTypeMemberKeywords(memberList);
} else if (identifierContext == IdentifierContexts.TypeContext && !((scope is BlockScope) && (scope.OuterScope is TypeScope))) // type but not member decl scope...
LanguageService.AddTypeKeywords(memberList, null);
else if (this.parsingStatement || scope is AttributeScope)
this.AddStatementKeywords(memberList, scope);
else if (identifierContext != IdentifierContexts.EventContext)
this.AddTypeMemberKeywords(memberList);
return;
}
if ((node == null || node is Namespace) && identifierContext == IdentifierContexts.AllContext){
if(this.parsingStatement)
this.AddStatementKeywords(memberList, scope);
else
this.AddTypeMemberKeywords(memberList);
}
}