private GetCompletionCategory ( IType type ) : CompletionCategory | ||
type | IType | |
Результат | CompletionCategory |
void AddVirtuals(Dictionary<string, bool> alreadyInserted, CompletionDataWrapper col, ITypeDefinition type, string modifiers, ITypeDefinition curType, int declarationBegin) { if (curType == null) return; foreach (var m in curType.Methods.Where (m => !m.IsConstructor && !m.IsDestructor).Cast<IMember> ().Concat (curType.Properties.Cast<IMember> ())) { if (m.IsSynthetic || curType.Kind != TypeKind.Interface && !(m.IsVirtual || m.IsOverride || m.IsAbstract)) continue; // filter out the "Finalize" methods, because finalizers should be done with destructors. if (m is IMethod && m.Name == "Finalize") continue; var data = factory.CreateNewOverrideCompletionData (declarationBegin, type.Parts.First (), m); string text = GetNameWithParamCount (m); // check if the member is already implemented bool foundMember = type.Members.Any (cm => GetNameWithParamCount (cm) == text); if (!foundMember && !alreadyInserted.ContainsKey (text)) { alreadyInserted [text] = true; data.CompletionCategory = col.GetCompletionCategory (curType); col.Add (data); } } }
protected virtual void AddVirtuals(List<IMember> alreadyInserted, CompletionDataWrapper col, string modifiers, IType curType, int declarationBegin) { if (curType == null) { return; } foreach (var m in curType.GetMembers ().Reverse ()) { if (curType.Kind != TypeKind.Interface && !m.IsOverridable) { continue; } // filter out the "Finalize" methods, because finalizers should be done with destructors. if (m is IMethod && m.Name == "Finalize") { continue; } var data = factory.CreateNewOverrideCompletionData( declarationBegin, currentType, m ); // check if the member is already implemented bool foundMember = curType.GetMembers().Any(cm => SignatureComparer.Ordinal.Equals( cm, m ) && cm.DeclaringTypeDefinition == curType.GetDefinition() ); if (foundMember) { continue; } if (alreadyInserted.Any(cm => SignatureComparer.Ordinal.Equals(cm, m))) continue; alreadyInserted.Add(m); data.CompletionCategory = col.GetCompletionCategory(m.DeclaringTypeDefinition); col.Add(data); } }
void AddVirtuals (Dictionary<string, bool> alreadyInserted, CompletionDataWrapper col, string modifiers, IType curType, int declarationBegin) { if (curType == null) return; foreach (var m in curType.GetMethods (m => !m.IsConstructor && !m.IsDestructor).Cast<IMember> ().Concat (curType.GetProperties ().Cast<IMember> ()).Reverse ()) { if (m.IsSynthetic || curType.Kind != TypeKind.Interface && !m.IsOverridable) continue; // filter out the "Finalize" methods, because finalizers should be done with destructors. if (m is IMethod && m.Name == "Finalize") continue; var data = factory.CreateNewOverrideCompletionData (declarationBegin, currentType, m); string text = GetNameWithParamCount (m); // check if the member is already implemented bool foundMember = curType.GetMembers ().Any (cm => GetNameWithParamCount (cm) == text && cm.DeclaringTypeDefinition == curType.GetDefinition ()); if (foundMember) continue; if (alreadyInserted.ContainsKey (text)) continue; alreadyInserted [text] = true; data.CompletionCategory = col.GetCompletionCategory (curType); col.Add (data); } }