本文整理汇总了C#中IMember.GetEditorBrowsableState方法的典型用法代码示例。如果您正苦于以下问题:C# IMember.GetEditorBrowsableState方法的具体用法?C# IMember.GetEditorBrowsableState怎么用?C# IMember.GetEditorBrowsableState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMember
的用法示例。
在下文中一共展示了IMember.GetEditorBrowsableState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddMember
public ICompletionData AddMember (IMember member)
{
var newData = Factory.CreateEntityCompletionData (member);
if (member.ParentAssembly != completion.ctx.CurrentAssembly) {
switch (completion.EditorBrowsableBehavior) {
case EditorBrowsableBehavior.Ignore:
break;
case EditorBrowsableBehavior.Normal:
var state = member.GetEditorBrowsableState();
if (state != System.ComponentModel.EditorBrowsableState.Always)
return null;
break;
case EditorBrowsableBehavior.IncludeAdvanced:
if (!member.IsBrowsable())
return null;
break;
default:
throw new ArgumentOutOfRangeException();
}
}
string memberKey = newData.DisplayText;
if (memberKey == null)
return null;
newData.CompletionCategory = GetCompletionCategory (member.DeclaringTypeDefinition);
List<ICompletionData> existingData;
data.TryGetValue (memberKey, out existingData);
if (existingData != null) {
if (member.SymbolKind == SymbolKind.Field || member.SymbolKind == SymbolKind.Property || member.SymbolKind == SymbolKind.Event)
return null;
var a = member as IEntity;
foreach (var d in existingData) {
if (!(d is IEntityCompletionData))
continue;
var b = ((IEntityCompletionData)d).Entity;
if (a == null || b == null || a.SymbolKind == b.SymbolKind) {
d.AddOverload (newData);
return d;
}
}
if (newData != null) {
result.Add (newData);
data [memberKey].Add (newData);
}
} else {
result.Add (newData);
data [memberKey] = new List<ICompletionData> ();
data [memberKey].Add (newData);
}
return newData;
}