本文整理汇总了C#中MemberList.RemoveAt方法的典型用法代码示例。如果您正苦于以下问题:C# MemberList.RemoveAt方法的具体用法?C# MemberList.RemoveAt怎么用?C# MemberList.RemoveAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemberList
的用法示例。
在下文中一共展示了MemberList.RemoveAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Declarations
public Declarations(MemberList memberList, AuthoringHelper helper, Node node, Scope scope){
this.node = node;
this.scope = scope;
this.displayTextForLastGetBestMatch = "";
this.helper = helper;
if (memberList == null || memberList.Count == 0) {
this.members = new Member[0];
this.helper = helper;
return;
}
Identifier tName = null;
TypeNode t = memberList[memberList.Count - 1] as TypeNode;
if (t != null)
tName = (t.Template == null) ? t.Name : t.Template.Name;
Member lastMemb = memberList[memberList.Count - 1];
if (lastMemb == null)
memberList.RemoveAt(memberList.Count - 1);
Member[] members = memberList.ToArray();
Array.Sort(members, this.GetMemberComparer(helper.culture)); //REVIEW: perhaps get it from helper?
MemberList memberList1 = new MemberList();
this.overloads = new int[members.Length];
String memberName = null;
bool doneAddingPreselection = !((node is Construct) || (node is Identifier)) || lastMemb == null;
int j = 0;
for (int i = 0; i < members.Length;){
Member mem = members[i];
if (mem == null){ i++; continue;}
if (mem.IsSpecialName || mem.FilterPriority == System.ComponentModel.EditorBrowsableState.Never){i++; continue;}
memberName = helper.GetMemberName(mem);
if (memberName == null || memberName.Length == 0){i++; continue;}
if (!doneAddingPreselection && mem.Name != null && tName != null && mem.Name.UniqueIdKey == tName.UniqueIdKey) {
this.initialMatch = memberList1.Count;
if (t != null && t.Template != null) { // t is implicitly not null since tName is not null but it's safer to check anyway.
memberList1.Add(t);
doneAddingPreselection = true;
if (t == (mem as TypeNode)) { i++; j++; continue; }
}
} else if (t != null && t == (mem as TypeNode) && t.Template != null) { // TODO: Perhaps check doneAddingPreselection here as well?
if (this.initialMatch >= 0) { i++; continue; }
this.initialMatch = memberList1.Count;
doneAddingPreselection = true;
} else if (!doneAddingPreselection && lastMemb == mem) {
if (this.initialMatch >= 0) { i++; continue; }
this.initialMatch = memberList1.Count;
doneAddingPreselection = true;
}
memberList1.Add(mem);
i++;
while (i < members.Length && helper.GetMemberName(members[i]) == memberName){
if (t != (members[i] as TypeNode) || (t == null && members[i] != null)) this.overloads[j]++;
i++;
}
j++;
}
members = memberList1.ToArray();
this.members = members;
}
示例2: 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);
}
}