Index: Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj
===================================================================
diff -u -r49bebd2cfc2cae266077222234b9bd42ff58e2a8 -r98939d3757e99732f74f6345b5eb58c90e30a4d4
--- Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision 49bebd2cfc2cae266077222234b9bd42ff58e2a8)
+++ Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision 98939d3757e99732f74f6345b5eb58c90e30a4d4)
@@ -127,9 +127,17 @@
MessageWindowDialog.cs
+
+
+
+
+
+
+
+
Index: Core/Common/src/Core.Common.Gui/IApplicationSelection.cs
===================================================================
diff -u
--- Core/Common/src/Core.Common.Gui/IApplicationSelection.cs (revision 0)
+++ Core/Common/src/Core.Common.Gui/IApplicationSelection.cs (revision 98939d3757e99732f74f6345b5eb58c90e30a4d4)
@@ -0,0 +1,22 @@
+using System;
+
+namespace Core.Common.Gui
+{
+ ///
+ /// Interface for keeping and notifying changes to the application selection.
+ ///
+ public interface IApplicationSelection
+ {
+ ///
+ /// Gets or sets current selected object(s). Visibility of the menus, toolbars and
+ /// other controls should be updated when selected object is changed. Default
+ /// implementation will also show it in the PropertyGrid.
+ ///
+ object Selection { get; set; }
+
+ ///
+ /// Fired when user changes selection by clicking on it or by setting it using property.
+ ///
+ event EventHandler SelectionChanged;
+ }
+}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/ICommandsOwner.cs
===================================================================
diff -u
--- Core/Common/src/Core.Common.Gui/ICommandsOwner.cs (revision 0)
+++ Core/Common/src/Core.Common.Gui/ICommandsOwner.cs (revision 98939d3757e99732f74f6345b5eb58c90e30a4d4)
@@ -0,0 +1,26 @@
+using System.Collections.Generic;
+
+namespace Core.Common.Gui
+{
+ ///
+ /// Object that holds the commands available within the application.
+ ///
+ public interface ICommandsOwner
+ {
+ ///
+ /// Gets or sets CommandHandler.
+ ///
+ IApplicationFeatureCommands ApplicationCommands { get; }
+
+ IStorageCommands StorageCommands { get; }
+
+ IProjectCommands ProjectCommands { get; }
+
+ IViewCommands ViewCommands { get; }
+
+ ///
+ /// Gets commands.
+ ///
+ IList Commands { get; }
+ }
+}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/IDocumentViewController.cs
===================================================================
diff -u
--- Core/Common/src/Core.Common.Gui/IDocumentViewController.cs (revision 0)
+++ Core/Common/src/Core.Common.Gui/IDocumentViewController.cs (revision 98939d3757e99732f74f6345b5eb58c90e30a4d4)
@@ -0,0 +1,43 @@
+using System;
+
+using Core.Common.Controls.Views;
+
+namespace Core.Common.Gui
+{
+ ///
+ /// Interface for controller that controls Document Views in the application.
+ ///
+ public interface IDocumentViewController
+ {
+ ///
+ /// Fired when the active view in the document pane changes.
+ ///
+ event EventHandler ActiveViewChanged;
+
+ ///
+ /// Gets the currently active document .
+ ///
+ IView ActiveView { get; }
+
+ ///
+ /// Gets all document views currently opened in the gui.
+ ///
+ IViewList DocumentViews { get; }
+
+ ///
+ /// Resolves document views
+ ///
+ IViewResolver DocumentViewsResolver { get; }
+
+ ///
+ /// Suspends view removal on item delete. Useful to avoid unnecessary checks (faster item removal).
+ ///
+ bool IsViewRemoveOnItemDeleteSuspended { get; set; }
+
+ ///
+ /// Update the tool tip for every view currently open. Reasons for doing so
+ /// include the modification of the tree structure which is reflected in a tool tip.
+ ///
+ void UpdateToolTips();
+ }
+}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/IGui.cs
===================================================================
diff -u -re96306bc32984aa50c6d1162167214024ddcf59a -r98939d3757e99732f74f6345b5eb58c90e30a4d4
--- Core/Common/src/Core.Common.Gui/IGui.cs (.../IGui.cs) (revision e96306bc32984aa50c6d1162167214024ddcf59a)
+++ Core/Common/src/Core.Common.Gui/IGui.cs (.../IGui.cs) (revision 98939d3757e99732f74f6345b5eb58c90e30a4d4)
@@ -1,19 +1,7 @@
-// --------------------------------------------------------------------------------------------------------------------
-// Deltares. All rights reserved.
-//
-// Provides graphical user interface logic required to work with an application.
-//
-// --------------------------------------------------------------------------------------------------------------------
-
using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Configuration;
-using Core.Common.Base.Data;
+
using Core.Common.Base.Plugin;
using Core.Common.Base.Storage;
-using Core.Common.Controls.Views;
-using Core.Common.Gui.Forms.MainWindow;
using Core.Common.Gui.Forms.PropertyGridView;
using Core.Common.Gui.PropertyBag;
@@ -22,143 +10,28 @@
///
/// Provides graphical user interface logic required to work with an application.
///
- public interface IGui : IDisposable
+ public interface IGui : ICommandsOwner, ISettingsOwner, IToolViewController, IProjectOwner,
+ IApplicationSelection, IDocumentViewController, IContextMenuBuilderProvider,
+ IMainWindowController, IGuiPluginsHost, IDisposable
{
- #region Public events
-
- event Action ProjectOpened;
- event Action ProjectClosing;
-
- #endregion
-
- #region Public Properties
-
///
- /// Gets the of the .
- ///
- ApplicationCore ApplicationCore { get; }
-
- ///
- /// Gets or sets the project of the .
- ///
- Project Project { get; set; }
-
- ///
- /// Gets or sets the project path of the .
- ///
- string ProjectFilePath { get; set; }
-
- ///
- /// Gets or sets CommandHandler.
- ///
- IApplicationFeatureCommands ApplicationCommands { get; }
-
- IStorageCommands StorageCommands { get; }
-
- IProjectCommands ProjectCommands { get; }
-
- IViewCommands ViewCommands { get; }
-
- ///
- /// Gets commands.
- ///
- IList Commands { get; }
-
- ///
- /// Gets the currently active document .
- ///
- IView ActiveView { get; }
-
- ///
- /// Gets all document views currently opened in the gui.
- ///
- IViewList DocumentViews { get; }
-
- ///
- /// Resolves document views
- ///
- IViewResolver DocumentViewsResolver { get; }
-
- ///
/// Object responsible for retrieving the instance
/// for a given data object and wrapping that in a
/// for the application to be used.
///
IPropertyResolver PropertyResolver { get; }
///
- /// Gets main window of the graphical user interface.
+ /// Gets the of the .
///
- IMainWindow MainWindow { get; }
+ ApplicationCore ApplicationCore { get; }
///
- /// Gets view manager used to handle tool windows.
- ///
- IViewList ToolWindowViews { get; }
-
- ///
- /// List of plugins.
- ///
- IList Plugins { get; }
-
- ///
- /// Gets the fixed settings of the .
- ///
- GuiCoreSettings FixedSettings { get; }
-
- ///
- /// Gets the user specific settings of the .
- ///
- ApplicationSettingsBase UserSettings { get; }
-
- ///
- /// Suspends view removal on item delete. Useful to avoid unnecessary checks (faster item removal).
- ///
- bool IsViewRemoveOnItemDeleteSuspended { get; set; }
-
- ///
- /// Gets or sets current selected object(s).
- /// Visibility of the menus, toolbars and other controls should be updated when selected object is changed.
- /// Default implementation will also show it in the PropertyGrid.
- ///
- object Selection { get; set; }
-
- ///
/// Gets or sets the current storage.
///
IStoreProject Storage { get; }
///
- /// Gets the of the
- ///
- IContextMenuBuilderProvider ContextMenuProvider { get; }
-
- #endregion
-
- #region Public Methods
-
- ///
- /// Exits gui by user request.
- ///
- void Exit();
-
- ///
- /// Returns GuiPlugin for a given type.
- /// TODO: a bit too implicit method, to be removed.
- ///
- /// Any type loaded from plugin.
- /// Plugin gui associated with a given type
- GuiPlugin GetPluginGuiForType(Type type);
-
- ///
- /// Queries the plugins to get all data with view definitions recursively given a
- /// piece of hierarchical data.
- ///
- /// The root data object.
- /// An enumeration of all (child)data that have view definitions declared.
- IEnumerable GetAllDataWithViewDefinitionsRecursively(object rootDataObject);
-
- ///
/// Runs gui. Internally it runs , initializes all user interface components, including
/// those loaded from plugins. After that it creates and shows main window.
///
@@ -171,47 +44,8 @@
void Run(string projectPath);
///
- /// Fully refreshes the user interface.
+ /// Exits gui by user request.
///
- void RefreshGui();
-
- ///
- /// Updates the title of the main window.
- ///
- void UpdateTitle();
-
- ///
- /// Update the tool tip for every view currently open. Reasons for doing so
- /// include the modification of the tree structure which is reflected in a tool tip.
- ///
- void UpdateToolTips();
-
- ///
- /// Open the tool view and make it visible in the interface.
- ///
- /// The tool view to open.
- void OpenToolView(IView toolView);
-
- ///
- /// Close the tool view removing it from the interface.
- ///
- /// The tool view to close.
- void CloseToolView(IView toolView);
-
- #endregion
-
- #region Events
-
- ///
- /// Fired when user changes selection by clicking on it or by setting it using Selection property.
- ///
- event EventHandler SelectionChanged;
-
- ///
- /// Fired when the active view in the document pane changes.
- ///
- event EventHandler ActiveViewChanged;
-
- #endregion
+ void Exit();
}
}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/IGuiPluginsHost.cs
===================================================================
diff -u
--- Core/Common/src/Core.Common.Gui/IGuiPluginsHost.cs (revision 0)
+++ Core/Common/src/Core.Common.Gui/IGuiPluginsHost.cs (revision 98939d3757e99732f74f6345b5eb58c90e30a4d4)
@@ -0,0 +1,34 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace Core.Common.Gui
+{
+ ///
+ /// Interface describing the object that hosts all the leaded graphical user interface
+ /// plugins of the application.
+ ///
+ public interface IGuiPluginsHost
+ {
+ ///
+ /// List of plugins.
+ ///
+ IList Plugins { get; }
+
+ ///
+ /// Returns GuiPlugin for a given type.
+ /// TODO: a bit too implicit method, to be removed.
+ ///
+ /// Any type loaded from plugin.
+ /// Plugin gui associated with a given type
+ GuiPlugin GetPluginGuiForType(Type type);
+
+ ///
+ /// Queries the plugins to get all data with view definitions recursively given a
+ /// piece of hierarchical data.
+ ///
+ /// The root data object.
+ /// An enumeration of all (child)data that have view definitions declared.
+ IEnumerable GetAllDataWithViewDefinitionsRecursively(object rootDataObject);
+ }
+}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/IMainWindowController.cs
===================================================================
diff -u
--- Core/Common/src/Core.Common.Gui/IMainWindowController.cs (revision 0)
+++ Core/Common/src/Core.Common.Gui/IMainWindowController.cs (revision 98939d3757e99732f74f6345b5eb58c90e30a4d4)
@@ -0,0 +1,26 @@
+using Core.Common.Gui.Forms.MainWindow;
+
+namespace Core.Common.Gui
+{
+ ///
+ /// Interface that declare member that allow for the controlling the main window of
+ /// the application.
+ ///
+ public interface IMainWindowController
+ {
+ ///
+ /// Gets main window of the graphical user interface.
+ ///
+ IMainWindow MainWindow { get; }
+
+ ///
+ /// Fully refreshes the user interface.
+ ///
+ void RefreshGui();
+
+ ///
+ /// Updates the title of the main window.
+ ///
+ void UpdateTitle();
+ }
+}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/IProjectOwner.cs
===================================================================
diff -u
--- Core/Common/src/Core.Common.Gui/IProjectOwner.cs (revision 0)
+++ Core/Common/src/Core.Common.Gui/IProjectOwner.cs (revision 98939d3757e99732f74f6345b5eb58c90e30a4d4)
@@ -0,0 +1,32 @@
+using System;
+
+using Core.Common.Base.Data;
+
+namespace Core.Common.Gui
+{
+ ///
+ /// Interface declaring members related to owning an .
+ ///
+ public interface IProjectOwner
+ {
+ ///
+ /// Occurs when a new instance is available at .
+ ///
+ event Action ProjectOpened;
+
+ ///
+ /// Occurs when the instance available at is removed.
+ ///
+ event Action ProjectClosing;
+
+ ///
+ /// Gets or sets the project of the .
+ ///
+ Project Project { get; set; }
+
+ ///
+ /// Gets or sets the project path of the .
+ ///
+ string ProjectFilePath { get; set; }
+ }
+}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/ISettingsOwner.cs
===================================================================
diff -u
--- Core/Common/src/Core.Common.Gui/ISettingsOwner.cs (revision 0)
+++ Core/Common/src/Core.Common.Gui/ISettingsOwner.cs (revision 98939d3757e99732f74f6345b5eb58c90e30a4d4)
@@ -0,0 +1,20 @@
+using System.Configuration;
+
+namespace Core.Common.Gui
+{
+ ///
+ /// Interface declaring the members of the object that holds settings.
+ ///
+ public interface ISettingsOwner
+ {
+ ///
+ /// Gets the fixed settings of the user interface.
+ ///
+ GuiCoreSettings FixedSettings { get; }
+
+ ///
+ /// Gets the user specific settings of the user interface.
+ ///
+ ApplicationSettingsBase UserSettings { get; }
+ }
+}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/IToolViewController.cs
===================================================================
diff -u
--- Core/Common/src/Core.Common.Gui/IToolViewController.cs (revision 0)
+++ Core/Common/src/Core.Common.Gui/IToolViewController.cs (revision 98939d3757e99732f74f6345b5eb58c90e30a4d4)
@@ -0,0 +1,27 @@
+using Core.Common.Controls.Views;
+
+namespace Core.Common.Gui
+{
+ ///
+ /// Interface for controller that controls Tool Views in the application.
+ ///
+ public interface IToolViewController
+ {
+ ///
+ /// Gets view manager used to handle tool windows.
+ ///
+ IViewList ToolWindowViews { get; }
+
+ ///
+ /// Open the tool view and make it visible in the interface.
+ ///
+ /// The tool view to open.
+ void OpenToolView(IView toolView);
+
+ ///
+ /// Close the tool view removing it from the interface.
+ ///
+ /// The tool view to close.
+ void CloseToolView(IView toolView);
+ }
+}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/RingtoetsGui.cs
===================================================================
diff -u -r109fecb57876eebf5108a34b8b7ab79f37559dd2 -r98939d3757e99732f74f6345b5eb58c90e30a4d4
--- Core/Common/src/Core.Common.Gui/RingtoetsGui.cs (.../RingtoetsGui.cs) (revision 109fecb57876eebf5108a34b8b7ab79f37559dd2)
+++ Core/Common/src/Core.Common.Gui/RingtoetsGui.cs (.../RingtoetsGui.cs) (revision 98939d3757e99732f74f6345b5eb58c90e30a4d4)
@@ -20,7 +20,6 @@
using Core.Common.Gui.Forms.SplashScreen;
using Core.Common.Gui.Forms.ViewManager;
using Core.Common.Gui.Properties;
-using Core.Common.Utils;
using Core.Common.Utils.Events;
using Core.Common.Utils.Extensions;
using Core.Common.Utils.Reflection;
@@ -34,7 +33,7 @@
///
/// Gui class provides graphical user functionality for a given IApplication.
///
- public class RingtoetsGui : IGui, IContextMenuBuilderProvider
+ public class RingtoetsGui : IGui
{
public event EventHandler SelectionChanged; // TODO: make it weak
public event EventHandler ActiveViewChanged;
Index: Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorerGuiPlugin.cs
===================================================================
diff -u -re96306bc32984aa50c6d1162167214024ddcf59a -r98939d3757e99732f74f6345b5eb58c90e30a4d4
--- Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorerGuiPlugin.cs (.../ProjectExplorerGuiPlugin.cs) (revision e96306bc32984aa50c6d1162167214024ddcf59a)
+++ Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorerGuiPlugin.cs (.../ProjectExplorerGuiPlugin.cs) (revision 98939d3757e99732f74f6345b5eb58c90e30a4d4)
@@ -36,12 +36,12 @@
/// An of .
/// Thrown when either:
///
- /// is null
- /// is null
+ /// is null
+ /// is null
///
public override IEnumerable GetProjectTreeViewNodePresenters()
{
- yield return new ProjectNodePresenter(Gui.ContextMenuProvider, Gui.ProjectCommands);
+ yield return new ProjectNodePresenter(Gui, Gui.ProjectCommands);
}
public override IEnumerable