本文整理汇总了C#中ICSharpCode.NRefactory.CSharp.Resolver.MemberLookup.GetAccessibleMembers方法的典型用法代码示例。如果您正苦于以下问题:C# MemberLookup.GetAccessibleMembers方法的具体用法?C# MemberLookup.GetAccessibleMembers怎么用?C# MemberLookup.GetAccessibleMembers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.NRefactory.CSharp.Resolver.MemberLookup
的用法示例。
在下文中一共展示了MemberLookup.GetAccessibleMembers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateCompletionData
//.........这里部分代码省略.........
} else {
result.Add(r);
}
}
}
}
}
}
if (resolveResult is TypeResolveResult && (resolvedNode is IdentifierExpression || resolvedNode is MemberReferenceExpression)) {
includeStaticMembers = true;
}
// Console.WriteLine ("type:" + type +"/"+type.GetType ());
// Console.WriteLine ("current:" + ctx.CurrentTypeDefinition);
// Console.WriteLine ("IS PROT ALLOWED:" + isProtectedAllowed + " static: "+ includeStaticMembers);
// Console.WriteLine (resolveResult);
// Console.WriteLine ("node:" + resolvedNode);
// Console.WriteLine (currentMember != null ? currentMember.IsStatic : "currentMember == null");
if (resolvedNode.Annotation<ObjectCreateExpression>() == null) {
//tags the created expression as part of an object create expression.
/*
var filteredList = new List<IMember>();
foreach (var member in type.GetMembers ()) {
filteredList.Add(member);
}
foreach (var member in filteredList) {
// Console.WriteLine ("add:" + member + "/" + member.IsStatic);
result.AddMember(member);
}*/
foreach (var member in lookup.GetAccessibleMembers (resolveResult)) {
if (member.SymbolKind == SymbolKind.Indexer || member.SymbolKind == SymbolKind.Operator || member.SymbolKind == SymbolKind.Constructor || member.SymbolKind == SymbolKind.Destructor) {
continue;
}
if (resolvedNode is BaseReferenceExpression && member.IsAbstract) {
continue;
}
if (member is IType) {
if (resolveResult is TypeResolveResult || includeStaticMembers) {
if (!lookup.IsAccessible(member, isProtectedAllowed))
continue;
result.AddType((IType)member, false);
continue;
}
}
bool memberIsStatic = member.IsStatic;
if (!includeStaticMembers && memberIsStatic && !(resolveResult is TypeResolveResult)) {
// Console.WriteLine ("skip static member: " + member.FullName);
continue;
}
var field = member as IField;
if (field != null) {
memberIsStatic |= field.IsConst;
}
if (!memberIsStatic && skipNonStaticMembers) {
continue;
}
if (member is IMethod && ((IMethod)member).FullName == "System.Object.Finalize") {
continue;
}
if (member.SymbolKind == SymbolKind.Operator) {