Index: Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs =================================================================== diff -u -r51580b6fac1bd49ee7b484291bf64bba6fb8e661 -r54c889ff0f67cd16eb8371a7e9c468444a4732ba --- Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs (.../MainWindow.xaml.cs) (revision 51580b6fac1bd49ee7b484291bf64bba6fb8e661) +++ Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs (.../MainWindow.xaml.cs) (revision 54c889ff0f67cd16eb8371a7e9c468444a4732ba) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; @@ -58,8 +57,6 @@ private MessageWindow.MessageWindow messageWindow; private PropertyGridView.PropertyGridView propertyGrid; - private IEnumerable ribbonCommandHandlers; - private IGui gui; /// @@ -217,16 +214,6 @@ } UpdateToolWindowButtonState(); - - if (ribbonCommandHandlers == null) - { - return; - } - - foreach (IRibbonCommandHandler ribbonCommandHandler in ribbonCommandHandlers) - { - ribbonCommandHandler.ValidateItems(); - } } public void Dispose() @@ -276,8 +263,6 @@ Close(); - ribbonCommandHandlers = null; - SetGui(null); } Index: Core/Common/test/Core.Common.Gui.Test/Plugin/PluginBaseTest.cs =================================================================== diff -u -r3d088548dfdebfd5c3adbbd67075b42e134f5c03 -r54c889ff0f67cd16eb8371a7e9c468444a4732ba --- Core/Common/test/Core.Common.Gui.Test/Plugin/PluginBaseTest.cs (.../PluginBaseTest.cs) (revision 3d088548dfdebfd5c3adbbd67075b42e134f5c03) +++ Core/Common/test/Core.Common.Gui.Test/Plugin/PluginBaseTest.cs (.../PluginBaseTest.cs) (revision 54c889ff0f67cd16eb8371a7e9c468444a4732ba) @@ -41,7 +41,6 @@ { // Assert Assert.IsNull(plugin.Gui); - Assert.IsNull(plugin.RibbonCommandHandler); } } Index: Core/Plugins/test/Core.Plugins.Chart.Test/ChartPluginTest.cs =================================================================== diff -u -r8fd5a65907925ec5246fc0630745a5a0ff52ef4d -r54c889ff0f67cd16eb8371a7e9c468444a4732ba --- Core/Plugins/test/Core.Plugins.Chart.Test/ChartPluginTest.cs (.../ChartPluginTest.cs) (revision 8fd5a65907925ec5246fc0630745a5a0ff52ef4d) +++ Core/Plugins/test/Core.Plugins.Chart.Test/ChartPluginTest.cs (.../ChartPluginTest.cs) (revision 54c889ff0f67cd16eb8371a7e9c468444a4732ba) @@ -22,11 +22,9 @@ using System; using System.Linq; using System.Threading; -using System.Windows; using System.Windows.Threading; using Core.Common.Base.Data; using Core.Common.Base.Storage; -using Core.Common.Controls.Views; using Core.Common.Gui; using Core.Common.Gui.Forms.MainWindow; using Core.Common.Gui.Forms.ViewHost; @@ -36,7 +34,6 @@ using Core.Common.Util.Reflection; using Core.Components.Chart.Data; using Core.Components.Chart.Forms; -using Core.Components.OxyPlot.Forms; using Core.Plugins.Chart.Legend; using Core.Plugins.Chart.PropertyClasses; using NUnit.Framework; @@ -55,7 +52,6 @@ { // Assert Assert.IsInstanceOf(plugin); - Assert.IsNull(plugin.RibbonCommandHandler); } } @@ -108,7 +104,6 @@ // Assert Assert.IsInstanceOf(plugin); - Assert.NotNull(plugin.RibbonCommandHandler); } mocks.VerifyAll(); @@ -159,48 +154,7 @@ } [Test] - [TestCase(true)] - [TestCase(false)] [Apartment(ApartmentState.STA)] - public void GivenConfiguredGui_WhenActiveDocumentViewChangesToViewWithChart_ThenRibbonSetVisibility(bool visible) - { - // Given - var mocks = new MockRepository(); - var projectStore = mocks.Stub(); - var projectMigrator = mocks.Stub(); - var projectFactory = mocks.Stub(); - projectFactory.Stub(pf => pf.CreateNewProject()).Return(mocks.Stub()); - mocks.ReplayAll(); - - using (var gui = new GuiCore(new MainWindow(), projectStore, projectMigrator, projectFactory, new GuiCoreSettings())) - { - var plugin = new ChartPlugin - { - Gui = gui - }; - - gui.Plugins.Add(plugin); - gui.Run(); - - var testChartView = new TestChartView - { - Data = new ChartControl() - }; - IView view = visible ? (IView) testChartView : new TestView(); - - // When - gui.ViewHost.AddDocumentView(view); - - // Then - Assert.AreEqual(visible ? Visibility.Visible : Visibility.Collapsed, plugin.RibbonCommandHandler.GetRibbonControl().ContextualGroups[0].Visibility); - } - - Dispatcher.CurrentDispatcher.InvokeShutdown(); - mocks.VerifyAll(); - } - - [Test] - [Apartment(ApartmentState.STA)] public void GivenConfiguredGui_WhenChartViewAdded_ThenComponentsUpdated() { // Given Index: Core/Plugins/test/Core.Plugins.Map.Test/MapPluginTest.cs =================================================================== diff -u -r06f019ab079a648ef19427dcf80ae4fc50cb32c1 -r54c889ff0f67cd16eb8371a7e9c468444a4732ba --- Core/Plugins/test/Core.Plugins.Map.Test/MapPluginTest.cs (.../MapPluginTest.cs) (revision 06f019ab079a648ef19427dcf80ae4fc50cb32c1) +++ Core/Plugins/test/Core.Plugins.Map.Test/MapPluginTest.cs (.../MapPluginTest.cs) (revision 54c889ff0f67cd16eb8371a7e9c468444a4732ba) @@ -22,11 +22,9 @@ using System; using System.Linq; using System.Threading; -using System.Windows; using System.Windows.Threading; using Core.Common.Base.Data; using Core.Common.Base.Storage; -using Core.Common.Controls.Views; using Core.Common.Gui; using Core.Common.Gui.Forms.MainWindow; using Core.Common.Gui.Forms.ViewHost; @@ -56,7 +54,6 @@ { // Assert Assert.IsInstanceOf(plugin); - Assert.IsNull(plugin.RibbonCommandHandler); } } @@ -111,7 +108,6 @@ // Assert Assert.IsInstanceOf(plugin); - Assert.NotNull(plugin.RibbonCommandHandler); } mocks.VerifyAll(); @@ -168,43 +164,6 @@ [Test] [Apartment(ApartmentState.STA)] - [TestCase(true)] - [TestCase(false)] - public void GivenConfiguredGui_WhenActiveDocumentViewChangesToViewWithMap_ThenRibbonSetVisibility(bool visible) - { - // Given - var mocks = new MockRepository(); - var projectStore = mocks.Stub(); - var projectMigrator = mocks.Stub(); - var projectFactory = mocks.Stub(); - projectFactory.Stub(pf => pf.CreateNewProject()).Return(mocks.Stub()); - mocks.ReplayAll(); - - using (var gui = new GuiCore(new MainWindow(), projectStore, projectMigrator, projectFactory, new GuiCoreSettings())) - { - var plugin = new MapPlugin - { - Gui = gui - }; - - gui.Plugins.Add(plugin); - gui.Run(); - - IView view = visible ? (IView) new TestMapView() : new TestView(); - - // When - gui.ViewHost.AddDocumentView(view); - - // Then - Assert.AreEqual(visible ? Visibility.Visible : Visibility.Collapsed, plugin.RibbonCommandHandler.GetRibbonControl().ContextualGroups[0].Visibility); - } - - Dispatcher.CurrentDispatcher.InvokeShutdown(); - mocks.VerifyAll(); - } - - [Test] - [Apartment(ApartmentState.STA)] public void GivenConfiguredGui_WhenMapViewOpened_ThenMapZoomedToExtents() { // Given Index: Core/Plugins/test/Core.Plugins.ProjectExplorer.Test/ProjectExplorerPluginTest.cs =================================================================== diff -u -rcbde09a1860a8a4480b958d6671de3480b995886 -r54c889ff0f67cd16eb8371a7e9c468444a4732ba --- Core/Plugins/test/Core.Plugins.ProjectExplorer.Test/ProjectExplorerPluginTest.cs (.../ProjectExplorerPluginTest.cs) (revision cbde09a1860a8a4480b958d6671de3480b995886) +++ Core/Plugins/test/Core.Plugins.ProjectExplorer.Test/ProjectExplorerPluginTest.cs (.../ProjectExplorerPluginTest.cs) (revision 54c889ff0f67cd16eb8371a7e9c468444a4732ba) @@ -47,7 +47,6 @@ // Assert Assert.IsInstanceOf(plugin); Assert.IsNull(plugin.Gui); - Assert.IsNull(plugin.RibbonCommandHandler); } } Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs =================================================================== diff -u -r2078097c19d6350eeebef21705d5b9199f430775 -r54c889ff0f67cd16eb8371a7e9c468444a4732ba --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs (.../RiskeerPluginTest.cs) (revision 2078097c19d6350eeebef21705d5b9199f430775) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs (.../RiskeerPluginTest.cs) (revision 54c889ff0f67cd16eb8371a7e9c468444a4732ba) @@ -76,7 +76,6 @@ { // Assert Assert.IsInstanceOf(plugin); - Assert.IsNull(plugin.RibbonCommandHandler); } }