//IClass lastClassInMembersComboBox; void GetGlobalUnitMembers(ArrayList items) { foreach (IBaseScope ss in currentCompilationUnit.Members) { switch (ss.SymbolInfo.kind) { case SymbolKind.Method: case SymbolKind.Constant: case SymbolKind.Variable: case SymbolKind.Event: case SymbolKind.Field: case SymbolKind.Parameter: case SymbolKind.Property: items.Add(new ComboBoxItem(ss, ss.GetDescriptionWithoutDoc(), CodeCompletionProvider.ImagesProvider.GetPictureNum(ss.SymbolInfo), true, false)); break; } } int ind = items.Count; items.Sort(0, items.Count, new Comparer(System.Globalization.CultureInfo.InvariantCulture)); if ((currentCompilationUnit as IInterfaceUnitScope).ImplementationUnitScope != null) { IImplementationUnitScope us = (currentCompilationUnit as IInterfaceUnitScope).ImplementationUnitScope; //items.Add(new ComboBoxItem(us,"implementation",CodeCompletionProvider.ImagesProvider.GetPictureNum(us.si),true)); foreach (IBaseScope ss in us.Members) { switch (ss.SymbolInfo.kind) { case SymbolKind.Method: case SymbolKind.Constant: case SymbolKind.Variable: case SymbolKind.Event: case SymbolKind.Field: case SymbolKind.Parameter: case SymbolKind.Property: items.Add(new ComboBoxItem(ss, ss.GetDescriptionWithoutDoc(), CodeCompletionProvider.ImagesProvider.GetPictureNum(ss.SymbolInfo), true, false)); break; } } items.Sort(ind, items.Count - ind, new Comparer(System.Globalization.CultureInfo.InvariantCulture)); } }
void AddClasses(ArrayList items) { IImplementationUnitScope impl = null; int ind = 0; if (currentCompilationUnit == null) { //items.Add(new ComboBoxItem(currentCompilationUnit,PascalABCCompiler.StringResources.Get("CODE_COMPLETION_GLOBAL"),CodeCompletionProvider.ImagesProvider.IconNumberUnitNamespace,true,true)); return; } if ((currentCompilationUnit as InterfaceUnitScope).impl_scope != null) { items.Add(new ComboBoxItem(currentCompilationUnit, PascalABCCompiler.StringResources.Get("CODE_COMPLETION_INTERFACE"), CodeCompletionProvider.ImagesProvider.GetPictureNum(currentCompilationUnit.SymbolInfo), true, false)); impl = (currentCompilationUnit as IInterfaceUnitScope).ImplementationUnitScope; items.Add(new ComboBoxItem(impl, PascalABCCompiler.StringResources.Get("CODE_COMPLETION_IMPLEMENTATION"), CodeCompletionProvider.ImagesProvider.GetPictureNum(impl.SymbolInfo), true, false)); ind = 2; } else { items.Add(new ComboBoxItem(currentCompilationUnit, PascalABCCompiler.StringResources.Get("CODE_COMPLETION_GLOBAL"), CodeCompletionProvider.ImagesProvider.IconNumberUnitNamespace, true, true)); ind = 1; } foreach (IBaseScope ss in currentCompilationUnit.Members) { switch (ss.SymbolInfo.kind) { case SymbolKind.Class: case SymbolKind.Struct: case SymbolKind.Type: case SymbolKind.Enum: case SymbolKind.Interface: case SymbolKind.Delegate: if (ss.GetPosition().file_name != null && !ss.SymbolInfo.name.Contains("$")) { items.Add(new ComboBoxItem(ss, ss.SymbolInfo.name, CodeCompletionProvider.ImagesProvider.GetPictureNum(ss.SymbolInfo), true, false)); } break; } } if (impl != null) { foreach (IBaseScope ss in impl.Members) { switch (ss.SymbolInfo.kind) { case SymbolKind.Class: case SymbolKind.Struct: case SymbolKind.Type: case SymbolKind.Enum: case SymbolKind.Interface: case SymbolKind.Delegate: if (ss.GetPosition().file_name != null && !ss.SymbolInfo.name.Contains("$")) { items.Add(new ComboBoxItem(ss, ss.SymbolInfo.name, CodeCompletionProvider.ImagesProvider.GetPictureNum(ss.SymbolInfo), true, false)); } break; } } } items.Sort(ind, items.Count - ind, new Comparer(System.Globalization.CultureInfo.InvariantCulture)); }