本文整理汇总了C#中MemberList.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# MemberList.Remove方法的具体用法?C# MemberList.Remove怎么用?C# MemberList.Remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemberList
的用法示例。
在下文中一共展示了MemberList.Remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetVisibleExternalElements
/// <summary>
/// Return the elements (package, types, etc) visible from the current file
/// </summary>
/// <param name="typesOnly">Return only packages & types</param>
/// <returns></returns>
public override MemberList GetVisibleExternalElements(bool typesOnly)
{
MemberList visibleElements = new MemberList();
if (!IsFileValid) return visibleElements;
// top-level elements
if (!typesOnly && topLevel != null)
{
if (topLevel.OutOfDate) InitTopLevelElements();
visibleElements.Add(topLevel.Members);
}
if (completionCache.IsDirty)
{
MemberList elements = new MemberList();
// root types & packages
FileModel baseElements = ResolvePackage(null, false);
if (baseElements != null)
{
elements.Add(baseElements.Imports);
elements.Add(baseElements.Members);
}
elements.Add(new MemberModel(features.voidKey, features.voidKey, FlagType.Class | FlagType.Intrinsic, 0));
bool qualify = Settings.CompletionShowQualifiedTypes && settings.GenerateImports;
// other classes in same package
if (features.hasPackages && cFile.Package != "")
{
FileModel packageElements = ResolvePackage(cFile.Package, false);
if (packageElements != null)
{
foreach (MemberModel member in packageElements.Imports)
{
if (member.Flags != FlagType.Package)
{
if (qualify) member.Name = member.Type;
elements.Add(member);
}
}
foreach (MemberModel member in packageElements.Members)
{
string pkg = member.InFile.Package;
if (qualify && pkg != "") member.Name = pkg + "." + member.Name;
elements.Add(member);
}
}
}
// other classes in same file
if (cFile.PrivateSectionIndex > 0)
{
if (inPrivateSection && cFile.Classes.Count > 1)
{
ClassModel mainClass = cFile.GetPublicClass();
if (!mainClass.IsVoid())
{
MemberModel toRemove = elements.Search(mainClass.Name, 0, 0);
if (toRemove != null && toRemove.Type == mainClass.QualifiedName)
elements.Remove(toRemove);
}
}
MemberModel member;
foreach (ClassModel aClass in cFile.Classes)
{
if (features.hasMultipleDefs || aClass.Access == Visibility.Private)
{
member = aClass.ToMemberModel();
elements.Add(member);
}
}
}
// imports
elements.Add(ResolveImports(CurrentModel));
// in cache
elements.Sort();
completionCache = new CompletionCache(this, elements);
// known classes colorization
if (!CommonSettings.DisableKnownTypesColoring && !settings.LazyClasspathExploration && CurSciControl != null)
{
try
{
CurSciControl.KeyWords(1, completionCache.Keywords); // additional-keywords index = 1
CurSciControl.Colourise(0, -1); // re-colorize the editor
}
catch (AccessViolationException){} // catch memory errors
}
}
visibleElements.Merge(completionCache.Elements);
return visibleElements;
}