diff --git a/src/AddIns/BackendBindings/VBNetBinding/Project/Resources/ProjectImports.xfrm b/src/AddIns/BackendBindings/VBNetBinding/Project/Resources/ProjectImports.xfrm index adb9cefe8e..0993c7d6af 100644 --- a/src/AddIns/BackendBindings/VBNetBinding/Project/Resources/ProjectImports.xfrm +++ b/src/AddIns/BackendBindings/VBNetBinding/Project/Resources/ProjectImports.xfrm @@ -7,7 +7,7 @@ - + @@ -15,7 +15,7 @@ - + @@ -32,7 +32,7 @@ - + @@ -41,7 +41,7 @@ - + diff --git a/src/AddIns/BackendBindings/VBNetBinding/Project/Src/OptionPanels/ProjectImports.cs b/src/AddIns/BackendBindings/VBNetBinding/Project/Src/OptionPanels/ProjectImports.cs index 85f8e775b5..22972ae271 100644 --- a/src/AddIns/BackendBindings/VBNetBinding/Project/Src/OptionPanels/ProjectImports.cs +++ b/src/AddIns/BackendBindings/VBNetBinding/Project/Src/OptionPanels/ProjectImports.cs @@ -1,8 +1,8 @@ // // 2002-2005 AlphaSierraPapa // GNU General Public License -// -// $Revision: 434 $ +// +// $Revision$ // using System; @@ -33,32 +33,33 @@ namespace VBNetBinding.OptionPanels Get("imports").SelectedIndexChanged += new EventHandler(importsListBox_SelectedIndexChanged); Get("namespaces").Items.Clear(); + Get("namespaces").AutoCompleteSource = AutoCompleteSource.ListItems; + Get("namespaces").AutoCompleteMode = AutoCompleteMode.Suggest; foreach(ProjectItem item in project.Items) { if(item.ItemType == ItemType.Import) { Get("imports").Items.Add(item.Include); } } - - DefaultProjectContent projectContent = (DefaultProjectContent)ParserService.GetProjectContent(project); - foreach(DefaultProjectContent refProjectContent in projectContent.ReferencedContents) - { - addNamespaces(refProjectContent); + + IProjectContent projectContent = ParserService.GetProjectContent(project); + foreach(IProjectContent refProjectContent in projectContent.ReferencedContents) { + AddNamespaces(refProjectContent); } - addNamespaces(projectContent); + AddNamespaces(projectContent); namespacesComboBox_TextCanged(null, EventArgs.Empty); importsListBox_SelectedIndexChanged(null, EventArgs.Empty); } - private void addNamespaces(DefaultProjectContent projectContent) + private void AddNamespaces(IProjectContent projectContent) { - Dictionary.KeyCollection namespaces = projectContent.NamespaceNames; - foreach(string projectNamespace in namespaces) - { - if(projectNamespace != "") { - Get("namespaces").Items.Add(projectNamespace); + foreach(string projectNamespace in projectContent.NamespaceNames) { + if (projectNamespace != "") { + if (!Get("namespaces").Items.Contains(projectNamespace)) { + Get("namespaces").Items.Add(projectNamespace); + } } } } diff --git a/src/Main/Base/Project/Src/Project/ConfigurationGuiBinding.cs b/src/Main/Base/Project/Src/Project/ConfigurationGuiBinding.cs index 4ee8f1e069..f8e79059dc 100644 --- a/src/Main/Base/Project/Src/Project/ConfigurationGuiBinding.cs +++ b/src/Main/Base/Project/Src/Project/ConfigurationGuiBinding.cs @@ -119,9 +119,6 @@ namespace ICSharpCode.SharpDevelop.Project public void Set(T value) { - if ((location & PropertyStorageLocations.UserFile) != 0) { - System.Diagnostics.Debugger.Break(); - } helper.SetProperty(property, value, location); } diff --git a/src/Main/Base/Project/Src/Services/ParserService/DefaultProjectContent.cs b/src/Main/Base/Project/Src/Services/ParserService/DefaultProjectContent.cs index ecb9e00128..96e0847e29 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/DefaultProjectContent.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/DefaultProjectContent.cs @@ -66,8 +66,7 @@ namespace ICSharpCode.Core } } - public Dictionary.KeyCollection NamespaceNames - { + public ICollection NamespaceNames { get { return Namespaces[0].Keys; } @@ -82,7 +81,7 @@ namespace ICSharpCode.Core } } - public struct NamespaceStruct + protected struct NamespaceStruct { public readonly List Classes; public readonly List SubNamespaces; @@ -94,6 +93,9 @@ namespace ICSharpCode.Core } } + /// + /// Gets the class dictionary that uses the name comparison rules of . + /// protected Dictionary GetClasses(LanguageProperties language) { for (int i = 0; i < classLists.Count; ++i) { @@ -114,6 +116,9 @@ namespace ICSharpCode.Core return d; } + /// + /// Gets the namespace dictionary that uses the name comparison rules of . + /// protected Dictionary GetNamespaces(LanguageProperties language) { for (int i = 0; i < namespaces.Count; ++i) { @@ -146,17 +151,12 @@ namespace ICSharpCode.Core } } - public List ReferencedContents { + public ICollection ReferencedContents { get { return referencedContents; } } - public bool HasReferenceTo(IProjectContent content) - { - return referencedContents.Contains(content); - } - LanguageProperties language = LanguageProperties.CSharp; /// diff --git a/src/Main/Base/Project/Src/Services/ParserService/IProjectContent.cs b/src/Main/Base/Project/Src/Services/ParserService/IProjectContent.cs index dcb67ca69e..9d65d28125 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/IProjectContent.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/IProjectContent.cs @@ -39,7 +39,13 @@ namespace ICSharpCode.Core get; } - bool HasReferenceTo(IProjectContent content); + ICollection NamespaceNames { + get; + } + + ICollection ReferencedContents { + get; + } /// /// Gets the properties of the language this project content was written in. diff --git a/src/Main/Base/Project/Src/Services/RefactoringService/RefactoringService.cs b/src/Main/Base/Project/Src/Services/RefactoringService/RefactoringService.cs index 668b69a3f2..f84537eb69 100644 --- a/src/Main/Base/Project/Src/Services/RefactoringService/RefactoringService.cs +++ b/src/Main/Base/Project/Src/Services/RefactoringService/RefactoringService.cs @@ -32,7 +32,7 @@ namespace ICSharpCode.SharpDevelop.Refactoring string baseClassFullName = baseClass.FullyQualifiedName; List list = new List(); foreach (IProjectContent pc in projectContents) { - if (pc != baseClass.ProjectContent && !pc.HasReferenceTo(baseClass.ProjectContent)) { + if (pc != baseClass.ProjectContent && !pc.ReferencedContents.Contains(baseClass.ProjectContent)) { // only project contents referencing the content of the base class // can derive from the class continue; @@ -320,7 +320,7 @@ namespace ICSharpCode.SharpDevelop.Refactoring // internal = can be only referenced from same project content continue; } - if (!pc.HasReferenceTo(ownerProjectContent)) { + if (!pc.ReferencedContents.Contains(ownerProjectContent)) { // project contents that do not reference the owner's content cannot reference the member continue; } diff --git a/src/Main/StartUp/Project/Resources/StringResources.resources b/src/Main/StartUp/Project/Resources/StringResources.resources index e7984fcd70..0b94aad5ca 100644 Binary files a/src/Main/StartUp/Project/Resources/StringResources.resources and b/src/Main/StartUp/Project/Resources/StringResources.resources differ