Index: Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj =================================================================== diff -u -r732e6ecce60a2e6122063e81449f5e083543c547 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision 732e6ecce60a2e6122063e81449f5e083543c547) +++ Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -152,7 +152,7 @@ - + Index: Core/Common/src/Core.Common.Gui/GuiCore.cs =================================================================== diff -u -r7709ae832723e3dd8499b674a7c78c75bae8e5d7 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Core/Common/src/Core.Common.Gui/GuiCore.cs (.../GuiCore.cs) (revision 7709ae832723e3dd8499b674a7c78c75bae8e5d7) +++ Core/Common/src/Core.Common.Gui/GuiCore.cs (.../GuiCore.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -116,7 +116,7 @@ isAlreadyRunningInstanceOfIGui = true; instanceCreationStackTrace = new StackTrace().ToString(); - Plugins = new List(); + Plugins = new List(); UserSettings = Properties.Settings.Default; @@ -396,7 +396,7 @@ } } - private void DeactivatePlugin(GuiPlugin plugin) + private void DeactivatePlugin(PluginBase plugin) { try { @@ -700,7 +700,7 @@ { Plugins.ForEachElementDo(p => p.Gui = this); - var problematicPlugins = new List(); + var problematicPlugins = new List(); // Try to activate all plugins foreach (var plugin in Plugins) @@ -974,7 +974,7 @@ #region Implementation: IGuiPluginHost - public IList Plugins { get; private set; } + public IList Plugins { get; private set; } public IEnumerable GetTreeNodeInfos() { Index: Core/Common/src/Core.Common.Gui/IGuiPluginsHost.cs =================================================================== diff -u -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Core/Common/src/Core.Common.Gui/IGuiPluginsHost.cs (.../IGuiPluginsHost.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) +++ Core/Common/src/Core.Common.Gui/IGuiPluginsHost.cs (.../IGuiPluginsHost.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -35,7 +35,7 @@ /// /// Gets the list of plugins. /// - IList Plugins { get; } + IList Plugins { get; } /// /// Queries the plugins to get all data with view definitions recursively, given a Fisheye: Tag 6fefc4422dcc5076f0ff430f73d829a6670f0285 refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Gui/Plugin/GuiPlugin.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Common/src/Core.Common.Gui/Plugin/PluginBase.cs =================================================================== diff -u --- Core/Common/src/Core.Common.Gui/Plugin/PluginBase.cs (revision 0) +++ Core/Common/src/Core.Common.Gui/Plugin/PluginBase.cs (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -0,0 +1,130 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Core.Common.Base.IO; +using Core.Common.Base.Plugin; +using Core.Common.Controls.TreeView; +using Core.Common.Gui.Forms; + +namespace Core.Common.Gui.Plugin +{ + /// + /// Template class for a plugin definitions. + /// + public abstract class PluginBase : IDisposable + { + /// + /// Gets or sets the gui. + /// + public virtual IGui Gui { get; set; } + + /// + /// Ribbon command handler (adding tabs, groups, buttons, etc.) which can be provided by the gui plugin. + /// + public virtual IRibbonCommandHandler RibbonCommandHandler + { + get + { + return null; + } + } + + /// + /// Activates the plugin. + /// + public virtual void Activate() {} + + /// + /// Deactivates the plugin. + /// + public virtual void Deactivate() {} + + /// + /// This method returns an enumeration of . + /// + /// The enumeration of provided by the . + public virtual IEnumerable GetFileImporters() + { + yield break; + } + + /// + /// This method returns an enumeration of . + /// + /// The enumeration of provided by the . + public virtual IEnumerable GetFileExporters() + { + yield break; + } + + /// + /// This method returns an enumeration of . + /// + /// The enumeration of provided by the . + public virtual IEnumerable GetDataItemInfos() + { + yield break; + } + + /// + /// Returns all instances provided for data of this plugin. + /// + public virtual IEnumerable GetPropertyInfos() + { + return Enumerable.Empty(); + } + + /// + /// Returns all instances provided for data of this plugin. + /// + public virtual IEnumerable GetViewInfos() + { + yield break; + } + + /// + /// Returns all instances provided for data of this plugin. + /// + public virtual IEnumerable GetTreeNodeInfos() + { + yield break; + } + + /// + /// Gets the child data instances that have definitions of + /// some parent data object. + /// + /// The parent data object. + /// Sequence of child data. + public virtual IEnumerable GetChildDataWithViewDefinitions(object dataObject) + { + yield break; + } + + public virtual void Dispose() + { + Gui = null; + } + } +} \ No newline at end of file Index: Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj =================================================================== diff -u -r3e0ac8e7988d37424638e2b768e15a783897e126 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj (.../Core.Common.Gui.Test.csproj) (revision 3e0ac8e7988d37424638e2b768e15a783897e126) +++ Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj (.../Core.Common.Gui.Test.csproj) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -141,7 +141,7 @@ - + Index: Core/Common/test/Core.Common.Gui.Test/Forms/MainWindow/MainWindowTest.cs =================================================================== diff -u -r151bab16a7ebc1bffc0621ab56c6dc219db1e90f -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Core/Common/test/Core.Common.Gui.Test/Forms/MainWindow/MainWindowTest.cs (.../MainWindowTest.cs) (revision 151bab16a7ebc1bffc0621ab56c6dc219db1e90f) +++ Core/Common/test/Core.Common.Gui.Test/Forms/MainWindow/MainWindowTest.cs (.../MainWindowTest.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -149,7 +149,7 @@ var gui = mocks.Stub(); gui.Stub(g => g.UserSettings).Return(settings); gui.Stub(g => g.FixedSettings).Return(new GuiCoreSettings()); - gui.Stub(g => g.Plugins).Return(Enumerable.Empty().ToList()); + gui.Stub(g => g.Plugins).Return(Enumerable.Empty().ToList()); gui.Stub(g => g.ToolWindowViews).Return(toolViewsList); mocks.ReplayAll(); @@ -186,7 +186,7 @@ var gui = mocks.Stub(); gui.Stub(g => g.UserSettings).Return(settings); gui.Stub(g => g.FixedSettings).Return(new GuiCoreSettings()); - gui.Stub(g => g.Plugins).Return(Enumerable.Empty().ToList()); + gui.Stub(g => g.Plugins).Return(Enumerable.Empty().ToList()); gui.Stub(g => g.ToolWindowViews).Return(toolViewsList); mocks.ReplayAll(); Index: Core/Common/test/Core.Common.Gui.Test/GuiCoreTest.cs =================================================================== diff -u -r151bab16a7ebc1bffc0621ab56c6dc219db1e90f -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Core/Common/test/Core.Common.Gui.Test/GuiCoreTest.cs (.../GuiCoreTest.cs) (revision 151bab16a7ebc1bffc0621ab56c6dc219db1e90f) +++ Core/Common/test/Core.Common.Gui.Test/GuiCoreTest.cs (.../GuiCoreTest.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -224,7 +224,7 @@ // Setup var mocks = new MockRepository(); var projectStore = mocks.Stub(); - var guiPluginMock = mocks.Stub(); + var guiPluginMock = mocks.Stub(); guiPluginMock.Expect(p => p.Deactivate()); guiPluginMock.Expect(p => p.Dispose()); mocks.ReplayAll(); @@ -247,7 +247,7 @@ // Setup var mocks = new MockRepository(); var projectStore = mocks.Stub(); - var guiPluginMock = mocks.Stub(); + var guiPluginMock = mocks.Stub(); guiPluginMock.Expect(p => p.Deactivate()).Throw(new Exception("Bad stuff happening!")); guiPluginMock.Expect(p => p.Dispose()); mocks.ReplayAll(); @@ -653,7 +653,7 @@ { var mocks = new MockRepository(); var projectStore = mocks.Stub(); - var guiPlugin = mocks.Stub(); + var guiPlugin = mocks.Stub(); guiPlugin.Stub(p => p.Deactivate()); guiPlugin.Stub(p => p.Dispose()); guiPlugin.Expect(p => p.Activate()); @@ -681,7 +681,7 @@ { var mocks = new MockRepository(); var projectStore = mocks.Stub(); - var guiPlugin = mocks.Stub(); + var guiPlugin = mocks.Stub(); guiPlugin.Stub(p => p.GetViewInfos()).Return(Enumerable.Empty()); guiPlugin.Stub(p => p.GetPropertyInfos()).Return(Enumerable.Empty()); guiPlugin.Stub(p => p.Activate()).Throw(new Exception("ERROR!")); @@ -707,7 +707,7 @@ { var mocks = new MockRepository(); var projectStore = mocks.Stub(); - var guiPlugin = mocks.Stub(); + var guiPlugin = mocks.Stub(); guiPlugin.Stub(p => p.GetViewInfos()).Return(Enumerable.Empty()); guiPlugin.Stub(p => p.GetPropertyInfos()).Return(Enumerable.Empty()); guiPlugin.Stub(p => p.Activate()).Throw(new Exception("ERROR!")); @@ -814,14 +814,14 @@ var mocks = new MockRepository(); var projectStore = mocks.Stub(); - var plugin1 = mocks.StrictMock(); + var plugin1 = mocks.StrictMock(); plugin1.Expect(p => p.GetChildDataWithViewDefinitions(rootData)).Return(new[] { rootData }); plugin1.Stub(p => p.Dispose()); plugin1.Stub(p => p.Deactivate()); - var plugin2 = mocks.StrictMock(); + var plugin2 = mocks.StrictMock(); plugin2.Expect(p => p.GetChildDataWithViewDefinitions(rootData)).Return(new[] { rootData @@ -858,7 +858,7 @@ var mocks = new MockRepository(); var projectStore = mocks.Stub(); - var plugin1 = mocks.StrictMock(); + var plugin1 = mocks.StrictMock(); plugin1.Expect(p => p.GetChildDataWithViewDefinitions(rootData)).Return(new[] { rootData, rootChild @@ -869,7 +869,7 @@ }); plugin1.Stub(p => p.Dispose()); plugin1.Stub(p => p.Deactivate()); - var plugin2 = mocks.StrictMock(); + var plugin2 = mocks.StrictMock(); plugin2.Expect(p => p.GetChildDataWithViewDefinitions(rootData)).Return(new[] { rootChild, rootData @@ -976,15 +976,15 @@ var mocks = new MockRepository(); var projectStore = mocks.Stub(); - var pluginA = mocks.Stub(); + var pluginA = mocks.Stub(); pluginA.Stub(p => p.GetTreeNodeInfos()).Return(nodesPluginA); pluginA.Stub(p => p.Dispose()); pluginA.Stub(p => p.Deactivate()); - var pluginB = mocks.Stub(); + var pluginB = mocks.Stub(); pluginB.Stub(p => p.GetTreeNodeInfos()).Return(nodesPluginB); pluginB.Stub(p => p.Dispose()); pluginB.Stub(p => p.Deactivate()); - var pluginC = mocks.Stub(); + var pluginC = mocks.Stub(); pluginC.Stub(p => p.GetTreeNodeInfos()).Return(nodesPluginC); pluginC.Stub(p => p.Dispose()); pluginC.Stub(p => p.Deactivate()); Fisheye: Tag 6fefc4422dcc5076f0ff430f73d829a6670f0285 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.Gui.Test/Plugin/GuiPluginTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Common/test/Core.Common.Gui.Test/Plugin/PluginBaseTest.cs =================================================================== diff -u --- Core/Common/test/Core.Common.Gui.Test/Plugin/PluginBaseTest.cs (revision 0) +++ Core/Common/test/Core.Common.Gui.Test/Plugin/PluginBaseTest.cs (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -0,0 +1,276 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Linq; +using Core.Common.Gui.Plugin; +using NUnit.Framework; +using Rhino.Mocks; + +namespace Core.Common.Gui.Test.Plugin +{ + [TestFixture] + public class PluginBaseTest + { + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + using (var plugin = new SimplePlugin()) + { + // Assert + Assert.IsNull(plugin.Gui); + Assert.IsNull(plugin.RibbonCommandHandler); + } + } + + [Test] + public void Gui_SetValue_GetNewlySetValue() + { + // Setup + var mocks = new MockRepository(); + var gui = mocks.Stub(); + mocks.ReplayAll(); + + using (var plugin = new SimplePlugin()) + { + // Call + plugin.Gui = gui; + + // Assert + Assert.AreEqual(gui, plugin.Gui); + } + mocks.VerifyAll(); + } + + [Test] + public void Activate_DoesNotThrow() + { + // Setup + var mocks = new MockRepository(); + var gui = mocks.StrictMock(); + mocks.ReplayAll(); + + using (var plugin = new SimplePlugin + { + Gui = gui + }) + { + // Call + TestDelegate call = () => plugin.Activate(); + + // Assert + Assert.DoesNotThrow(call); + } + mocks.VerifyAll(); + } + + [Test] + public void Deactivate_DoesNotThrow() + { + // Setup + var mocks = new MockRepository(); + var gui = mocks.StrictMock(); + mocks.ReplayAll(); + + using (var plugin = new SimplePlugin + { + Gui = gui + }) + { + // Call + TestDelegate call = () => plugin.Deactivate(); + + // Assert + Assert.DoesNotThrow(call); + } + mocks.VerifyAll(); + } + + [Test] + public void GetPropertyInfos_ReturnsEmpty() + { + // Setup + var mocks = new MockRepository(); + var gui = mocks.StrictMock(); + mocks.ReplayAll(); + + using (var plugin = new SimplePlugin + { + Gui = gui + }) + { + // Call + var infos = plugin.GetPropertyInfos(); + + // Assert + CollectionAssert.IsEmpty(infos); + } + mocks.VerifyAll(); + } + + [Test] + public void GetViewInfos_ReturnsEmpty() + { + // Setup + var mocks = new MockRepository(); + var gui = mocks.StrictMock(); + mocks.ReplayAll(); + + using (var plugin = new SimplePlugin + { + Gui = gui + }) + { + // Call + var infos = plugin.GetViewInfos(); + + // Assert + CollectionAssert.IsEmpty(infos); + } + mocks.VerifyAll(); + } + + [Test] + public void GetTreeNodeInfos_ReturnsEmpty() + { + // Setup + var mocks = new MockRepository(); + var gui = mocks.StrictMock(); + mocks.ReplayAll(); + + using (var plugin = new SimplePlugin + { + Gui = gui + }) + { + // Call + var infos = plugin.GetTreeNodeInfos(); + + // Assert + CollectionAssert.IsEmpty(infos); + } + mocks.VerifyAll(); + } + + [Test] + public void GetChildDataWithViewDefinitions_ReturnsEmpty() + { + // Setup + var mocks = new MockRepository(); + var gui = mocks.StrictMock(); + mocks.ReplayAll(); + + using (var plugin = new SimplePlugin + { + Gui = gui + }) + { + // Call + var infos = plugin.GetChildDataWithViewDefinitions(null); + + // Assert + CollectionAssert.IsEmpty(infos); + } + mocks.VerifyAll(); + } + + [Test] + public void GetFileImporters_ReturnsEmpty() + { + // Setup + var mocks = new MockRepository(); + var gui = mocks.StrictMock(); + mocks.ReplayAll(); + + using (var plugin = new SimplePlugin + { + Gui = gui + }) + { + // Call + var infos = plugin.GetFileImporters(); + + // Assert + CollectionAssert.IsEmpty(infos); + } + mocks.VerifyAll(); + } + + [Test] + public void GetFileExporters_ReturnsEmptyEnumerable() + { + // Setup + var mocks = new MockRepository(); + var gui = mocks.StrictMock(); + mocks.ReplayAll(); + + using (var plugin = new SimplePlugin + { + Gui = gui + }) + { + // Call + var infos = plugin.GetFileExporters(); + + // Assert + CollectionAssert.IsEmpty(infos); + } + mocks.VerifyAll(); + } + + [Test] + public void GetDataItemInfos_ReturnEmptyEnumerable() + { + // Setup + var guiPlugin = new SimplePlugin(); + + // Call + var dataItemInfos = guiPlugin.GetDataItemInfos().ToArray(); + + // Assert + CollectionAssert.IsEmpty(dataItemInfos); + } + + [Test] + public void Dispose_SetGuiToNull() + { + // Setup + var mocks = new MockRepository(); + var gui = mocks.Stub(); + mocks.ReplayAll(); + + using (var plugin = new SimplePlugin + { + Gui = gui + }) + { + // Call + plugin.Dispose(); + + // Assert + Assert.IsNull(plugin.Gui); + } + mocks.VerifyAll(); + } + + private class SimplePlugin : PluginBase {} + } +} \ No newline at end of file Index: Core/Plugins/src/Core.Plugins.CommonTools/CommonToolsGuiPlugin.cs =================================================================== diff -u -r67980a5c3c5cb71c185278e849b123e7f92990eb -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Core/Plugins/src/Core.Plugins.CommonTools/CommonToolsGuiPlugin.cs (.../CommonToolsGuiPlugin.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb) +++ Core/Plugins/src/Core.Plugins.CommonTools/CommonToolsGuiPlugin.cs (.../CommonToolsGuiPlugin.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -34,7 +34,7 @@ /// /// This class configures general GUI components. /// - public class CommonToolsGuiPlugin : GuiPlugin + public class CommonToolsGuiPlugin : PluginBase { public override IEnumerable GetPropertyInfos() { Index: Core/Plugins/src/Core.Plugins.DotSpatial/DotSpatialGuiPlugin.cs =================================================================== diff -u -recef7aa46cb8fb7d138a5cc00a35f9e7aa7676b6 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Core/Plugins/src/Core.Plugins.DotSpatial/DotSpatialGuiPlugin.cs (.../DotSpatialGuiPlugin.cs) (revision ecef7aa46cb8fb7d138a5cc00a35f9e7aa7676b6) +++ Core/Plugins/src/Core.Plugins.DotSpatial/DotSpatialGuiPlugin.cs (.../DotSpatialGuiPlugin.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -37,7 +37,7 @@ /// /// The gui plugin for the map component. /// - public class DotSpatialGuiPlugin : GuiPlugin + public class DotSpatialGuiPlugin : PluginBase { private MapRibbon mapRibbon; private MapLegendController mapLegendController; Index: Core/Plugins/src/Core.Plugins.OxyPlot/OxyPlotGuiPlugin.cs =================================================================== diff -u -r170ec8698dfed095e23f4fa822fe2198b3e5f242 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Core/Plugins/src/Core.Plugins.OxyPlot/OxyPlotGuiPlugin.cs (.../OxyPlotGuiPlugin.cs) (revision 170ec8698dfed095e23f4fa822fe2198b3e5f242) +++ Core/Plugins/src/Core.Plugins.OxyPlot/OxyPlotGuiPlugin.cs (.../OxyPlotGuiPlugin.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -36,7 +36,7 @@ /// /// This class ties all the components together to enable charting interaction. /// - public class OxyPlotGuiPlugin : GuiPlugin + public class OxyPlotGuiPlugin : PluginBase { private ChartingRibbon chartingRibbon; Index: Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorerGuiPlugin.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorerGuiPlugin.cs (.../ProjectExplorerGuiPlugin.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectExplorerGuiPlugin.cs (.../ProjectExplorerGuiPlugin.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -36,7 +36,7 @@ namespace Core.Plugins.ProjectExplorer { - public class ProjectExplorerGuiPlugin : GuiPlugin + public class ProjectExplorerGuiPlugin : PluginBase { private IToolViewController toolViewController; private ProjectExplorerViewController projectExplorerViewController; Index: Core/Plugins/test/Core.Plugins.DotSpatial.Test/DotSpatialGuiPluginTest.cs =================================================================== diff -u -r151bab16a7ebc1bffc0621ab56c6dc219db1e90f -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Core/Plugins/test/Core.Plugins.DotSpatial.Test/DotSpatialGuiPluginTest.cs (.../DotSpatialGuiPluginTest.cs) (revision 151bab16a7ebc1bffc0621ab56c6dc219db1e90f) +++ Core/Plugins/test/Core.Plugins.DotSpatial.Test/DotSpatialGuiPluginTest.cs (.../DotSpatialGuiPluginTest.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -51,7 +51,7 @@ using (var plugin = new DotSpatialGuiPlugin()) { // Assert - Assert.IsInstanceOf(plugin); + Assert.IsInstanceOf(plugin); Assert.IsNull(plugin.RibbonCommandHandler); } } @@ -118,7 +118,7 @@ plugin.Activate(); // Assert - Assert.IsInstanceOf(plugin); + Assert.IsInstanceOf(plugin); Assert.NotNull(plugin.RibbonCommandHandler); } mocks.VerifyAll(); Index: Core/Plugins/test/Core.Plugins.OxyPlot.Test/OxyPlotGuiPluginTest.cs =================================================================== diff -u -r151bab16a7ebc1bffc0621ab56c6dc219db1e90f -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Core/Plugins/test/Core.Plugins.OxyPlot.Test/OxyPlotGuiPluginTest.cs (.../OxyPlotGuiPluginTest.cs) (revision 151bab16a7ebc1bffc0621ab56c6dc219db1e90f) +++ Core/Plugins/test/Core.Plugins.OxyPlot.Test/OxyPlotGuiPluginTest.cs (.../OxyPlotGuiPluginTest.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -51,7 +51,7 @@ using (var plugin = new OxyPlotGuiPlugin()) { // Assert - Assert.IsInstanceOf(plugin); + Assert.IsInstanceOf(plugin); Assert.IsNull(plugin.RibbonCommandHandler); } } @@ -113,7 +113,7 @@ plugin.Activate(); // Assert - Assert.IsInstanceOf(plugin); + Assert.IsInstanceOf(plugin); Assert.NotNull(plugin.RibbonCommandHandler); } mocks.VerifyAll(); Index: Core/Plugins/test/Core.Plugins.ProjectExplorer.Test/ProjectExplorerGuiPluginTest.cs =================================================================== diff -u -r151bab16a7ebc1bffc0621ab56c6dc219db1e90f -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Core/Plugins/test/Core.Plugins.ProjectExplorer.Test/ProjectExplorerGuiPluginTest.cs (.../ProjectExplorerGuiPluginTest.cs) (revision 151bab16a7ebc1bffc0621ab56c6dc219db1e90f) +++ Core/Plugins/test/Core.Plugins.ProjectExplorer.Test/ProjectExplorerGuiPluginTest.cs (.../ProjectExplorerGuiPluginTest.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -44,7 +44,7 @@ using (var plugin = new ProjectExplorerGuiPlugin()) { // Assert - Assert.IsInstanceOf(plugin); + Assert.IsInstanceOf(plugin); Assert.IsNull(plugin.Gui); Assert.IsNull(plugin.RibbonCommandHandler); } @@ -59,7 +59,7 @@ using (var projectExplorerGuiPlugin = new ProjectExplorerGuiPlugin()) { var gui = mocks.StrictMock(); - var otherGuiPlugin = mocks.StrictMock(); + var otherGuiPlugin = mocks.StrictMock(); gui.Expect(g => g.ViewCommands).Return(mocks.Stub()); gui.Expect(g => g.GetTreeNodeInfos()).Return(Enumerable.Empty()); @@ -69,7 +69,7 @@ gui.Expect(g => g.ProjectOpened += Arg>.Is.Anything); gui.Expect(g => g.ProjectOpened -= Arg>.Is.Anything); - gui.Expect(g => g.Plugins).Return(new List + gui.Expect(g => g.Plugins).Return(new List { projectExplorerGuiPlugin, otherGuiPlugin }).Repeat.Any(); Index: Demo/Ringtoets/src/Demo.Ringtoets/GUIs/DemoProjectGuiPlugin.cs =================================================================== diff -u -r64d5609bb2912cd52dc74deffdd189222e240599 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Demo/Ringtoets/src/Demo.Ringtoets/GUIs/DemoProjectGuiPlugin.cs (.../DemoProjectGuiPlugin.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599) +++ Demo/Ringtoets/src/Demo.Ringtoets/GUIs/DemoProjectGuiPlugin.cs (.../DemoProjectGuiPlugin.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -1,18 +1,19 @@ using Core.Common.Gui.Forms; using Core.Common.Gui.Plugin; +using Demo.Ringtoets.Ribbons; namespace Demo.Ringtoets.GUIs { /// /// UI plugin the provides access to the demo projects for Ringtoets. /// - public class DemoProjectGuiPlugin : GuiPlugin + public class DemoProjectGuiPlugin : PluginBase { public override IRibbonCommandHandler RibbonCommandHandler { get { - return new Ribbons.RingtoetsDemoProjectRibbon(Gui, Gui); + return new RingtoetsDemoProjectRibbon(Gui, Gui); } } } Index: Demo/Ringtoets/test/Demo.Ringtoets.Test/GUIs/DemoProjectGuiPluginTest.cs =================================================================== diff -u -r64d5609bb2912cd52dc74deffdd189222e240599 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Demo/Ringtoets/test/Demo.Ringtoets.Test/GUIs/DemoProjectGuiPluginTest.cs (.../DemoProjectGuiPluginTest.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599) +++ Demo/Ringtoets/test/Demo.Ringtoets.Test/GUIs/DemoProjectGuiPluginTest.cs (.../DemoProjectGuiPluginTest.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -17,7 +17,7 @@ using (var plugin = new DemoProjectGuiPlugin()) { // Assert - Assert.IsInstanceOf(plugin); + Assert.IsInstanceOf(plugin); Assert.IsInstanceOf(plugin.RibbonCommandHandler); } } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs =================================================================== diff -u -rbb4c3689ba695776176d0a03d24e5025b27594ed -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs (.../GrassCoverErosionInwardsGuiPlugin.cs) (revision bb4c3689ba695776176d0a03d24e5025b27594ed) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs (.../GrassCoverErosionInwardsGuiPlugin.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -58,7 +58,7 @@ /// /// The GUI plug-in for the . /// - public class GrassCoverErosionInwardsGuiPlugin : GuiPlugin + public class GrassCoverErosionInwardsGuiPlugin : PluginBase { public override IEnumerable GetPropertyInfos() { Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/GrassCoverErosionInwardsGuiPluginTest.cs =================================================================== diff -u -raf42240385db3d3f04bca830513c7464e6f74668 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/GrassCoverErosionInwardsGuiPluginTest.cs (.../GrassCoverErosionInwardsGuiPluginTest.cs) (revision af42240385db3d3f04bca830513c7464e6f74668) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/GrassCoverErosionInwardsGuiPluginTest.cs (.../GrassCoverErosionInwardsGuiPluginTest.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -20,7 +20,6 @@ // All rights reserved. using System.Linq; -using Core.Common.Base.Plugin; using Core.Common.Controls.TreeView; using Core.Common.Gui; using Core.Common.Gui.Commands; @@ -47,7 +46,7 @@ using (var grassCoverErosionInwardsGuiPlugin = new GrassCoverErosionInwardsGuiPlugin()) { // assert - Assert.IsInstanceOf(grassCoverErosionInwardsGuiPlugin); + Assert.IsInstanceOf(grassCoverErosionInwardsGuiPlugin); } } @@ -99,11 +98,8 @@ { // setup var mocks = new MockRepository(); - var applicationCore = new ApplicationCore(); var guiStub = mocks.Stub(); guiStub.Stub(g => g.ApplicationCommands).Return(mocks.Stub()); - - Expect.Call(guiStub.ApplicationCore).Return(applicationCore).Repeat.Any(); mocks.ReplayAll(); using (var guiPlugin = new GrassCoverErosionInwardsGuiPlugin @@ -135,13 +131,10 @@ { // Setup var mocks = new MockRepository(); - var applicationCore = new ApplicationCore(); var guiStub = mocks.Stub(); guiStub.Stub(g => g.ApplicationCommands).Return(mocks.Stub()); - guiStub.Stub(g => g.ApplicationCore).Return(applicationCore); - mocks.ReplayAll(); using (var guiPlugin = new GrassCoverErosionInwardsGuiPlugin @@ -166,13 +159,8 @@ { // Setup var mocks = new MockRepository(); - var applicationCore = new ApplicationCore(); - var guiStub = mocks.Stub(); guiStub.Stub(g => g.ApplicationCommands).Return(mocks.Stub()); - - guiStub.Stub(g => g.ApplicationCore).Return(applicationCore); - mocks.ReplayAll(); using (var guiPlugin = new GrassCoverErosionInwardsGuiPlugin Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresGuiPlugin.cs =================================================================== diff -u -r6377a7a3521a804190c503f9ae1f1fe9050d6546 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresGuiPlugin.cs (.../HeightStructuresGuiPlugin.cs) (revision 6377a7a3521a804190c503f9ae1f1fe9050d6546) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresGuiPlugin.cs (.../HeightStructuresGuiPlugin.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -50,7 +50,7 @@ /// /// The GUI plug-in for the . /// - public class HeightStructuresGuiPlugin : GuiPlugin + public class HeightStructuresGuiPlugin : PluginBase { public override IEnumerable GetPropertyInfos() { Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/HeightStructuresGuiPluginTest.cs =================================================================== diff -u -r95e76a7e90e94621a5e9773c2a365fa8e3b6dd31 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/HeightStructuresGuiPluginTest.cs (.../HeightStructuresGuiPluginTest.cs) (revision 95e76a7e90e94621a5e9773c2a365fa8e3b6dd31) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/HeightStructuresGuiPluginTest.cs (.../HeightStructuresGuiPluginTest.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -20,7 +20,6 @@ // All rights reserved. using System.Linq; -using Core.Common.Base.Plugin; using Core.Common.Controls.TreeView; using Core.Common.Gui; using Core.Common.Gui.Commands; @@ -46,7 +45,7 @@ using (var heightStructuresGuiPlugin = new HeightStructuresGuiPlugin()) { // Assert - Assert.IsInstanceOf(heightStructuresGuiPlugin); + Assert.IsInstanceOf(heightStructuresGuiPlugin); } } @@ -85,12 +84,8 @@ { // Setup var mocks = new MockRepository(); - var applicationCore = new ApplicationCore(); var guiStub = mocks.Stub(); - guiStub.Stub(g => g.ApplicationCommands).Return(mocks.Stub()); - Expect.Call(guiStub.ApplicationCore).Return(applicationCore).Repeat.Any(); - mocks.ReplayAll(); using (var guiPlugin = new HeightStructuresGuiPlugin @@ -120,13 +115,8 @@ { // Setup var mocks = new MockRepository(); - var applicationCore = new ApplicationCore(); - var guiStub = mocks.Stub(); guiStub.Stub(g => g.ApplicationCommands).Return(mocks.Stub()); - - guiStub.Stub(g => g.ApplicationCore).Return(applicationCore); - mocks.ReplayAll(); using (var guiPlugin = new HeightStructuresGuiPlugin Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs =================================================================== diff -u -r7709ae832723e3dd8499b674a7c78c75bae8e5d7 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision 7709ae832723e3dd8499b674a7c78c75bae8e5d7) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -79,9 +79,9 @@ /// /// The GUI plugin for the Ringtoets application. /// - public class RingtoetsGuiPlugin : GuiPlugin + public class RingtoetsGuiPlugin : PluginBase { - private static readonly ILog log = LogManager.GetLogger(typeof(GuiPlugin)); + private static readonly ILog log = LogManager.GetLogger(typeof(PluginBase)); #region failureMechanismAssociations Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/CommentContextTreeNodeInfoTest.cs =================================================================== diff -u -rc9396d0af18873fda14c7e486decbfca7d4e8b21 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/CommentContextTreeNodeInfoTest.cs (.../CommentContextTreeNodeInfoTest.cs) (revision c9396d0af18873fda14c7e486decbfca7d4e8b21) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/CommentContextTreeNodeInfoTest.cs (.../CommentContextTreeNodeInfoTest.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -149,7 +149,7 @@ mocks.VerifyAll(); } - private TreeNodeInfo GetInfo(Core.Common.Gui.Plugin.GuiPlugin gui) + private TreeNodeInfo GetInfo(Core.Common.Gui.Plugin.PluginBase gui) { return gui.GetTreeNodeInfos().First(tni => tni.TagType == typeof(CommentContext)); } Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsGuiPluginTest.cs =================================================================== diff -u -r7709ae832723e3dd8499b674a7c78c75bae8e5d7 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsGuiPluginTest.cs (.../RingtoetsGuiPluginTest.cs) (revision 7709ae832723e3dd8499b674a7c78c75bae8e5d7) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsGuiPluginTest.cs (.../RingtoetsGuiPluginTest.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -70,7 +70,7 @@ using (var ringtoetsGuiPlugin = new RingtoetsGuiPlugin()) { // Assert - Assert.IsInstanceOf(ringtoetsGuiPlugin); + Assert.IsInstanceOf(ringtoetsGuiPlugin); Assert.IsInstanceOf(ringtoetsGuiPlugin.RibbonCommandHandler); } } @@ -341,12 +341,7 @@ { // Setup var mocks = new MockRepository(); - var applicationCore = new ApplicationCore(); - var guiStub = mocks.DynamicMultiMock(typeof(IGui), typeof(IContextMenuBuilderProvider)); - - guiStub.Expect(g => g.ApplicationCore).Return(applicationCore).Repeat.Any(); - mocks.ReplayAll(); using (var guiPlugin = new RingtoetsGuiPlugin Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs =================================================================== diff -u -raf42240385db3d3f04bca830513c7464e6f74668 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision af42240385db3d3f04bca830513c7464e6f74668) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -55,7 +55,7 @@ /// /// The GUI plug-in for the . /// - public class PipingGuiPlugin : GuiPlugin + public class PipingGuiPlugin : PluginBase { public override IRibbonCommandHandler RibbonCommandHandler { Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingGuiPluginTest.cs =================================================================== diff -u -raf42240385db3d3f04bca830513c7464e6f74668 -r6fefc4422dcc5076f0ff430f73d829a6670f0285 --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingGuiPluginTest.cs (.../PipingGuiPluginTest.cs) (revision af42240385db3d3f04bca830513c7464e6f74668) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingGuiPluginTest.cs (.../PipingGuiPluginTest.cs) (revision 6fefc4422dcc5076f0ff430f73d829a6670f0285) @@ -21,7 +21,6 @@ using System; using System.Linq; -using Core.Common.Base.Plugin; using Core.Common.Controls.TreeView; using Core.Common.Gui; using Core.Common.Gui.Commands; @@ -51,7 +50,7 @@ using (var ringtoetsGuiPlugin = new PipingGuiPlugin()) { // assert - Assert.IsInstanceOf(ringtoetsGuiPlugin); + Assert.IsInstanceOf(ringtoetsGuiPlugin); Assert.IsInstanceOf(ringtoetsGuiPlugin.RibbonCommandHandler); } } @@ -116,13 +115,8 @@ { // setup var mocks = new MockRepository(); - var applicationCore = new ApplicationCore(); - var guiStub = mocks.Stub(); guiStub.Stub(g => g.ApplicationCommands).Return(mocks.Stub()); - - Expect.Call(guiStub.ApplicationCore).Return(applicationCore).Repeat.Any(); - mocks.ReplayAll(); using (var guiPlugin = new PipingGuiPlugin @@ -157,13 +151,8 @@ { // Setup var mocks = new MockRepository(); - var applicationCore = new ApplicationCore(); - var guiStub = mocks.Stub(); guiStub.Stub(g => g.ApplicationCommands).Return(mocks.Stub()); - - guiStub.Stub(g => g.ApplicationCore).Return(applicationCore); - mocks.ReplayAll(); using (var guiPlugin = new PipingGuiPlugin @@ -190,13 +179,8 @@ { // Setup var mocks = new MockRepository(); - var applicationCore = new ApplicationCore(); - var guiStub = mocks.Stub(); guiStub.Stub(g => g.ApplicationCommands).Return(mocks.Stub()); - - guiStub.Stub(g => g.ApplicationCore).Return(applicationCore); - mocks.ReplayAll(); using (var guiPlugin = new PipingGuiPlugin