Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Properties/Resources.Designer.cs =================================================================== diff -u -re7acba10209b18e88bf89d9211f6fc031d0f992e -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e7acba10209b18e88bf89d9211f6fc031d0f992e) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.18444 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -62,7 +62,7 @@ /// /// Looks up a localized string similar to -- - ///-- File generated with SQLiteStudio v3.0.7 on Fri Jan 29 11:47:02 2016 + ///-- File generated with SQLiteStudio v3.0.7 on Thu Feb 11 11:54:23 2016 ///-- ///-- Text encoding used: windows-1252 ///-- @@ -81,10 +81,8 @@ ///); /// /// - ///-- Table: ProjectEntity - ///DROP TABLE IF EXISTS ProjectEntity; - /// - ///CREATE TAB [rest of string was truncated]";. + ///-- Table: DuneAssessmentSectionEntity + ///DROP TABLE IF EXISTS DuneAssessment [rest of string was truncated]";. /// internal static string DatabaseStructure { get { @@ -136,5 +134,14 @@ return ResourceManager.GetString("Error_Write_Structure_to_Database", resourceCulture); } } + + /// + /// Looks up a localized string similar to Ringtoetsproject (*.rtd)|*.rtd. + /// + internal static string Ringtoets_project_file_filter { + get { + return ResourceManager.GetString("Ringtoets_project_file_filter", resourceCulture); + } + } } } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Properties/Resources.resx =================================================================== diff -u -re7acba10209b18e88bf89d9211f6fc031d0f992e -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Properties/Resources.resx (.../Resources.resx) (revision e7acba10209b18e88bf89d9211f6fc031d0f992e) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Properties/Resources.resx (.../Resources.resx) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -136,4 +136,7 @@ Een fout is opgetreden met schrijven naar het nieuwe Ringtoets bestand. + + Ringtoetsproject (*.rtd)|*.rtd + \ No newline at end of file Index: Application/Ringtoets/src/Application.Ringtoets.Storage/StorageSqLite.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Application/Ringtoets/src/Application.Ringtoets.Storage/StorageSqLite.cs (.../StorageSqLite.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/StorageSqLite.cs (.../StorageSqLite.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -25,14 +25,17 @@ using System.Data.Entity; using System.IO; using System.Linq; + using Application.Ringtoets.Storage.DbContext; using Application.Ringtoets.Storage.Exceptions; using Application.Ringtoets.Storage.Persistors; using Application.Ringtoets.Storage.Properties; + using Core.Common.Base.Data; using Core.Common.Base.Storage; using Core.Common.Utils; using Core.Common.Utils.Builders; + using UtilsResources = Core.Common.Utils.Properties.Resources; namespace Application.Ringtoets.Storage @@ -45,6 +48,14 @@ private string filePath; private string connectionString; + public string FileFilter + { + get + { + return Resources.Ringtoets_project_file_filter; + } + } + /// /// Converts to a new in the database. /// Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/StorageSqLiteTest.cs =================================================================== diff -u -r99a9ff7746c6c38cfe963c8702fd386b34f98701 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/StorageSqLiteTest.cs (.../StorageSqLiteTest.cs) (revision 99a9ff7746c6c38cfe963c8702fd386b34f98701) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/StorageSqLiteTest.cs (.../StorageSqLiteTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -23,6 +23,19 @@ } [Test] + public void DefaultConstructor_ExpectedValues() + { + // Setup + + // Call + var storage = new StorageSqLite(); + + // Assert + Assert.IsInstanceOf(storage); + Assert.AreEqual("Ringtoetsproject (*.rtd)|*.rtd", storage.FileFilter); + } + + [Test] [TestCase(null)] [TestCase("")] [TestCase(" ")] Index: Core/Common/src/Core.Common.Base/IObserver.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Base/IObserver.cs (.../IObserver.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Base/IObserver.cs (.../IObserver.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -22,13 +22,15 @@ namespace Core.Common.Base { /// - /// Interface that describes the methods that need to be implemented on classes that are supposed to be observer. + /// Interface that describes the methods that need to be implemented on classes that + /// observe an observable object. /// /// public interface IObserver { /// - /// This method performs an update of the , triggered by a notification of an . + /// This method performs an update of the , triggered by a + /// notification of an . /// void UpdateObserver(); } Index: Core/Common/src/Core.Common.Base/Storage/IStoreProject.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Base/Storage/IStoreProject.cs (.../IStoreProject.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Base/Storage/IStoreProject.cs (.../IStoreProject.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -30,6 +30,11 @@ public interface IStoreProject { /// + /// Gets the file name filter string. + /// + string FileFilter { get; } + + /// /// Converts to a new storage entry. /// /// to save. Index: Core/Common/src/Core.Common.Gui/Commands/ApplicationFeatureCommandHandler.cs =================================================================== diff -u -r8760b8163ab56db9718bdb17715304bc1c7d63a9 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Commands/ApplicationFeatureCommandHandler.cs (.../ApplicationFeatureCommandHandler.cs) (revision 8760b8163ab56db9718bdb17715304bc1c7d63a9) +++ Core/Common/src/Core.Common.Gui/Commands/ApplicationFeatureCommandHandler.cs (.../ApplicationFeatureCommandHandler.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -46,6 +46,13 @@ private readonly IMainWindow mainWindow; private readonly IApplicationSelection applicationSelection; + /// + /// Initializes a new instance of the class. + /// + /// The object responsible for finding the object properties + /// for a given data object. + /// The main user interface of the application. + /// The application's selection mechanism. public ApplicationFeatureCommandHandler(IPropertyResolver propertyResolver, IMainWindow mainWindow, IApplicationSelection applicationSelection) { this.propertyResolver = propertyResolver; Index: Core/Common/src/Core.Common.Gui/Commands/ExportImportCommandHandler.cs =================================================================== diff -u -r8760b8163ab56db9718bdb17715304bc1c7d63a9 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Commands/ExportImportCommandHandler.cs (.../ExportImportCommandHandler.cs) (revision 8760b8163ab56db9718bdb17715304bc1c7d63a9) +++ Core/Common/src/Core.Common.Gui/Commands/ExportImportCommandHandler.cs (.../ExportImportCommandHandler.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -32,7 +32,7 @@ namespace Core.Common.Gui.Commands { /// - /// Class responsible for exporting and importing of data. + /// Class responsible for exporting and importing data. /// public class ExportImportCommandHandler : IExportImportCommandHandler { Index: Core/Common/src/Core.Common.Gui/Commands/GuiExportHandler.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Commands/GuiExportHandler.cs (.../GuiExportHandler.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Commands/GuiExportHandler.cs (.../GuiExportHandler.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -71,8 +71,8 @@ } /// - /// Ask the user for the source file to import data from, then perform the import - /// on the target object. + /// Ask the user for the target file to export data to, then perform the export + /// using the source object. /// /// The importer to use. /// The import target. Index: Core/Common/src/Core.Common.Gui/Commands/IApplicationFeatureCommands.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Commands/IApplicationFeatureCommands.cs (.../IApplicationFeatureCommands.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Commands/IApplicationFeatureCommands.cs (.../IApplicationFeatureCommands.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -27,20 +27,20 @@ public interface IApplicationFeatureCommands { /// - /// Makes the properties window visible for the given object and select it. + /// Makes the properties window visible for the given object and selects it. /// /// The object for which to show its properties. void ShowPropertiesFor(object obj); /// - /// Indicates if there is a property-edit window is defined for some object. + /// Indicates if there is a property-edit window defined for some object. /// /// The object to check. /// true if a property view is defined, false otherwise. bool CanShowPropertiesFor(object obj); /// - /// Opens the current log-file, or the folder with logs if no current log-file available. + /// Opens the current log-file, or the folder with logs if no current log-file is available. /// void OpenLogFileExternal(); } Index: Core/Common/src/Core.Common.Gui/Commands/IExportImportCommandHandler.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Commands/IExportImportCommandHandler.cs (.../IExportImportCommandHandler.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Commands/IExportImportCommandHandler.cs (.../IExportImportCommandHandler.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -32,6 +32,7 @@ /// Indicates if there are importers for the given object. /// /// The object to check importer availability for. + /// True if there are importers available, false otherwise. bool CanImportOn(object obj); /// @@ -51,15 +52,16 @@ /// Indicates if there are exporters for the given object. /// /// The object to check exporter availability for. + /// True if there are exporters available, false otherwise. bool CanExportFrom(object obj); /// /// Perform the export workflow by: /// - /// If multiple exporters are available for target data object, ask the user + /// If multiple exporters are available for source data object, ask the user /// which exporter to use; /// Ask the user which file or file-destination to export to; - /// Export from the target data object to the specified location. + /// Export from the source data object to the specified location. /// /// /// The data to export. Index: Core/Common/src/Core.Common.Gui/Commands/IProjectCommands.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Commands/IProjectCommands.cs (.../IProjectCommands.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Commands/IProjectCommands.cs (.../IProjectCommands.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -32,15 +32,6 @@ public interface IProjectCommands { /// - /// Ask the user which data object should be created such that it can be added to the project. - /// - /// The owner of the new child data. - /// The supported data types. - /// The child data object that should be added to the project. - /// This method should not add the new data object to an instance. - object AddNewChildItem(object parent, IEnumerable childItemTypes); - - /// /// Ask the user which data object should be created and then add it to the project. /// /// The data parent. Index: Core/Common/src/Core.Common.Gui/Commands/IStorageCommands.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Commands/IStorageCommands.cs (.../IStorageCommands.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Commands/IStorageCommands.cs (.../IStorageCommands.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -66,7 +66,7 @@ bool OpenExistingProject(string filePath); /// - /// Close current project and and related views. + /// Close the current project and related views. /// void CloseProject(); } Index: Core/Common/src/Core.Common.Gui/Commands/IViewCommands.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Commands/IViewCommands.cs (.../IViewCommands.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Commands/IViewCommands.cs (.../IViewCommands.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -27,11 +27,6 @@ public interface IViewCommands { /// - /// Asks the user to select a view for the application's selection. - /// - void OpenSelectViewDialog(); - - /// /// Open the view for the application's selection. /// /// If multiple views are available, the user is asked which view to use. @@ -56,20 +51,7 @@ /// Indicates if a there are any views available for the application's selection. /// /// The data object to open views for. - /// true if there are any views for , false otherwise. + /// True if there are any views for , false otherwise. bool CanOpenViewFor(object dataObject); - - /// - /// Indicates if a there are any views available for the application's selection. - /// - /// True if there are any supported views for the current selection, - /// false otherwise. - bool CanOpenSelectViewDialog(); - - /// - /// Gets the data of current active Document View. - /// - /// The view data, or null if there is no active view. - object GetDataOfActiveView(); } } \ No newline at end of file Index: Core/Common/src/Core.Common.Gui/Commands/ProjectCommandHandler.cs =================================================================== diff -u --- Core/Common/src/Core.Common.Gui/Commands/ProjectCommandHandler.cs (revision 0) +++ Core/Common/src/Core.Common.Gui/Commands/ProjectCommandHandler.cs (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -0,0 +1,119 @@ +// 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.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +using Core.Common.Base.Data; +using Core.Common.Base.Plugin; +using Core.Common.Gui.Forms; +using Core.Common.Gui.Properties; +using Core.Common.Gui.Selection; + +using log4net; + +namespace Core.Common.Gui.Commands +{ + /// + /// This class provides concrete implementations for . + /// + public class ProjectCommandHandler : IProjectCommands + { + private static readonly ILog log = LogManager.GetLogger(typeof(ProjectCommandHandler)); + + private readonly IProjectOwner projectOwner; + private readonly IWin32Window dialogOwner; + private readonly ApplicationCore applicationCore; + private readonly IApplicationSelection applicationSelection; + private readonly IDocumentViewController documentViewController; + + /// + /// Initializes a new instance of the class. + /// + /// Class owning the application's instance. + /// The window on which dialogs should be shown on top. + /// The application-plugins host. + /// The application selection mechanism. + /// The controller for Document Views. + public ProjectCommandHandler(IProjectOwner projectOwner, IWin32Window dialogParent, + ApplicationCore applicationCore, IApplicationSelection applicationSelection, + IDocumentViewController documentViewController) + { + this.projectOwner = projectOwner; + dialogOwner = dialogParent; + this.applicationCore = applicationCore; + this.applicationSelection = applicationSelection; + this.documentViewController = documentViewController; + } + + public void AddNewItem(object parent) + { + if (projectOwner.Project == null) + { + log.Error(Resources.ProjectCommandHandler_AddNewItem_There_needs_to_be_a_project_to_add_an_item); + } + + using (var selectDataDialog = CreateSelectionDialogWithItems(applicationCore.GetSupportedDataItemInfos(parent).ToArray())) + { + if (selectDataDialog.ShowDialog() == DialogResult.OK) + { + var newItem = GetNewDataObject(parent, selectDataDialog.SelectedItemTag as DataItemInfo); + if (newItem != null) + { + AddItemToProject(newItem); + + applicationSelection.Selection = newItem; + documentViewController.DocumentViewsResolver.OpenViewForData(applicationSelection.Selection); + } + } + } + } + + public void AddItemToProject(object newItem) + { + projectOwner.Project.Items.Add(newItem); + projectOwner.Project.NotifyObservers(); + } + + private SelectItemDialog CreateSelectionDialogWithItems(IEnumerable dataItemInfos) + { + var selectDataDialog = new SelectItemDialog(dialogOwner); + + foreach (var dataItemInfo in dataItemInfos) + { + selectDataDialog.AddItemType(dataItemInfo.Name, dataItemInfo.Category, dataItemInfo.Image, dataItemInfo); + } + + return selectDataDialog; + } + + private static object GetNewDataObject(object parent, DataItemInfo dataItemInfo) + { + if (dataItemInfo == null) + { + return null; + } + + return dataItemInfo.CreateData != null ? dataItemInfo.CreateData(parent) : null; + } + } +} \ No newline at end of file Fisheye: Tag ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Gui/Commands/ProjectCommandsHandler.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Common/src/Core.Common.Gui/Commands/StorageCommandHandler.cs =================================================================== diff -u -r8760b8163ab56db9718bdb17715304bc1c7d63a9 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Commands/StorageCommandHandler.cs (.../StorageCommandHandler.cs) (revision 8760b8163ab56db9718bdb17715304bc1c7d63a9) +++ Core/Common/src/Core.Common.Gui/Commands/StorageCommandHandler.cs (.../StorageCommandHandler.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -54,7 +54,7 @@ /// The class owning the application project. /// Class managing the application selection. /// Controller for UI. - /// Controller for Tool Windows. + /// Controller for Tool Views. /// The view command handler. public StorageCommandHandler(IStoreProject projectStorage, IProjectOwner projectOwner, IApplicationSelection applicationSelection, IMainWindowController mainWindowController, @@ -71,9 +71,6 @@ this.projectOwner.ProjectClosing += ApplicationProjectClosing; } - /// - /// This method performs an update of the , triggered by a notification of an . - /// public void UpdateObserver() { mainWindowController.RefreshGui(); @@ -95,7 +92,7 @@ { using (var openFileDialog = new OpenFileDialog { - Filter = Resources.Ringtoets_project_file_filter, + Filter = projectPersistor.FileFilter, FilterIndex = 1, RestoreDirectory = true }) @@ -159,7 +156,7 @@ return false; } - var filePath = OpenRingtoetsProjectFileSaveDialog(project.Name); + var filePath = OpenProjectFileSaveDialog(project.Name); if (String.IsNullOrWhiteSpace(filePath)) { return false; @@ -233,16 +230,16 @@ } /// - /// Prompts a new to select a location for saving the Ringtoets project file. + /// Prompts a new to select a location for saving the project file. /// /// A string containing the file name selected in the file dialog box. /// The selected project file, or null otherwise. - private static string OpenRingtoetsProjectFileSaveDialog(string projectName) + private string OpenProjectFileSaveDialog(string projectName) { // show file open dialog and select project file using (var saveFileDialog = new SaveFileDialog { - Filter = string.Format(Resources.Ringtoets_project_file_filter), + Filter = projectPersistor.FileFilter, FilterIndex = 1, RestoreDirectory = true, FileName = projectName Index: Core/Common/src/Core.Common.Gui/Commands/ViewCommandHandler.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Commands/ViewCommandHandler.cs (.../ViewCommandHandler.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Commands/ViewCommandHandler.cs (.../ViewCommandHandler.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -53,22 +53,6 @@ this.guiPluginsHost = guiPluginsHost; } - public object GetDataOfActiveView() - { - return documentViewController.DocumentViews.ActiveView != null ? documentViewController.DocumentViews.ActiveView.Data : null; - } - - public bool CanOpenSelectViewDialog() - { - return applicationSelection.Selection != null && - documentViewController.DocumentViewsResolver.GetViewInfosFor(applicationSelection.Selection).Count() > 1; - } - - public void OpenSelectViewDialog() - { - documentViewController.DocumentViewsResolver.OpenViewForData(applicationSelection.Selection, true); - } - public void OpenViewForSelection() { OpenView(applicationSelection.Selection); Index: Core/Common/src/Core.Common.Gui/ContextMenu/ContextMenuBuilder.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/ContextMenu/ContextMenuBuilder.cs (.../ContextMenuBuilder.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/ContextMenu/ContextMenuBuilder.cs (.../ContextMenuBuilder.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -38,8 +38,7 @@ private readonly ContextMenuStrip contextMenu; /// - /// Creates a new instance of , which uses the given to - /// create a for the given . + /// Creates a new instance of . /// /// The from which to obtain information to render and bind actions /// to the items of the . If null, this builder will not render items which @@ -53,8 +52,7 @@ /// If null, this builder will not render items which require this type of information. /// The data object for which to create a . /// The to use while executing the actions. - /// Thrown when the required object instances could not be created based on - /// the or . + /// Thrown when the any input argument is null. public ContextMenuBuilder(IApplicationFeatureCommands featureCommandHandler, IExportImportCommandHandler importExportHandler, IViewCommands viewsCommandsHandler, object dataObject, TreeViewControl treeViewControl) { try Index: Core/Common/src/Core.Common.Gui/ContextMenu/GuiContextMenuItemFactory.cs =================================================================== diff -u -rdc41fb966f99f5200c570d70e16397087ffa87c8 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/ContextMenu/GuiContextMenuItemFactory.cs (.../GuiContextMenuItemFactory.cs) (revision dc41fb966f99f5200c570d70e16397087ffa87c8) +++ Core/Common/src/Core.Common.Gui/ContextMenu/GuiContextMenuItemFactory.cs (.../GuiContextMenuItemFactory.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -28,9 +28,7 @@ namespace Core.Common.Gui.ContextMenu { /// - /// This class represents a factory for creating . The - /// items the factory creates are dependent on a set for this - /// factory. + /// This class represents a factory for creating . /// internal class GuiContextMenuItemFactory { @@ -40,8 +38,7 @@ private readonly object dataObject; /// - /// Creates a new instance of , which uses the - /// to create . + /// Creates a new instance of . /// /// The which contains information for creating the /// . @@ -115,7 +112,7 @@ /// /// Creates a which is bound to the action of importing - /// the data of the given . + /// to the data of the given . /// /// The created . public ToolStripItem CreateImportItem() Index: Core/Common/src/Core.Common.Gui/ContextMenu/IContextMenuBuilder.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/ContextMenu/IContextMenuBuilder.cs (.../IContextMenuBuilder.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/ContextMenu/IContextMenuBuilder.cs (.../IContextMenuBuilder.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -31,7 +31,6 @@ /// public interface IContextMenuBuilder { - /// /// Adds an item to the , which starts edit mode for the name of . /// @@ -60,28 +59,24 @@ /// Adds an item to the , which opens a view for the data of the . /// /// The itself. - /// Thrown when the was not passed on construction. IContextMenuBuilder AddOpenItem(); /// /// Adds an item to the , which exports the data of the . /// /// The itself. - /// Thrown when the was not passed on construction. IContextMenuBuilder AddExportItem(); /// - /// Adds an item to the , which imports the data of the . + /// Adds an item to the , which imports to the data of the . /// /// The itself. - /// Thrown when the was not passed on construction. IContextMenuBuilder AddImportItem(); /// /// Adds an item to the , which shows properties of the data of the . /// /// The itself. - /// Thrown when the was not passed on construction. IContextMenuBuilder AddPropertiesItem(); /// Index: Core/Common/src/Core.Common.Gui/ContextMenu/StrictContextMenuItem.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/ContextMenu/StrictContextMenuItem.cs (.../StrictContextMenuItem.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/ContextMenu/StrictContextMenuItem.cs (.../StrictContextMenuItem.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -26,7 +26,7 @@ namespace Core.Common.Gui.ContextMenu { /// - /// Class used by the to enforce instantiation the following properties. + /// Class used by the to enforce instantiation of the following properties: /// /// /// Index: Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj =================================================================== diff -u -rdc41fb966f99f5200c570d70e16397087ffa87c8 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision dc41fb966f99f5200c570d70e16397087ffa87c8) +++ Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -127,7 +127,7 @@ - + @@ -145,6 +145,7 @@ + @@ -165,7 +166,7 @@ - + Index: Core/Common/src/Core.Common.Gui/Forms/IRibbonCommandHandler.cs =================================================================== diff -u -r652b03cb8115830641e05bffb356bcf5779bc9f0 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/IRibbonCommandHandler.cs (.../IRibbonCommandHandler.cs) (revision 652b03cb8115830641e05bffb356bcf5779bc9f0) +++ Core/Common/src/Core.Common.Gui/Forms/IRibbonCommandHandler.cs (.../IRibbonCommandHandler.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -26,8 +26,8 @@ namespace Core.Common.Gui.Forms { /// - /// Interface declaring member for providing a control, commands used by that - /// Ribbon control and controller methods. + /// Interface declaring a member for providing a control, commands + /// used by that control and controller methods. /// public interface IRibbonCommandHandler { @@ -37,7 +37,7 @@ IEnumerable Commands { get; } /// - /// Gets control. + /// Gets the control. /// Ribbon GetRibbonControl(); @@ -52,7 +52,7 @@ /// /// Name of the contextual group. /// Name of the tab. - /// Returns true if tab should be shown, false otherwise. + /// Returns true if the tab should be shown; false otherwise. bool IsContextualTabVisible(string tabGroupName, string tabName); } } \ No newline at end of file Index: Core/Common/src/Core.Common.Gui/Forms/MainWindow/IMainWindow.cs =================================================================== diff -u -r6ef8fa312a72f486be984ebc3adde4be044811e2 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/MainWindow/IMainWindow.cs (.../IMainWindow.cs) (revision 6ef8fa312a72f486be984ebc3adde4be044811e2) +++ Core/Common/src/Core.Common.Gui/Forms/MainWindow/IMainWindow.cs (.../IMainWindow.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -75,7 +75,7 @@ void SetWaitCursorOn(); /// - /// Change the cursor to display the default cursor. + /// Changes the cursor to display the default cursor. /// void SetWaitCursorOff(); Index: Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs =================================================================== diff -u -r6ef8fa312a72f486be984ebc3adde4be044811e2 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs (.../MainWindow.xaml.cs) (revision 6ef8fa312a72f486be984ebc3adde4be044811e2) +++ Core/Common/src/Core.Common.Gui/Forms/MainWindow/MainWindow.xaml.cs (.../MainWindow.xaml.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -214,9 +214,8 @@ } /// - /// Sets the GUI and dependencies. + /// Sets the and dependencies. /// - /// The GUI implementation. public void SetGui(IGui value) { gui = value; @@ -229,7 +228,7 @@ } /// - /// Subscribes the main user interface to the GUI provided by . + /// Subscribes the main user interface to the provided by . /// public void SubscribeToGui() { @@ -245,7 +244,7 @@ } /// - /// Unsubscribes the main user interface from the GUI provided by . + /// Unsubscribes the main user interface from the provided by . /// public void UnsubscribeFromGui() { @@ -282,7 +281,7 @@ /// Initializes and shows all the tool windows. /// /// - /// When a gui hasn't been set with . + /// When a hasn't been set with . /// public void InitializeToolWindows() { @@ -393,7 +392,7 @@ /// Initializes and shows the property grid tool window. /// /// - /// When a gui hasn't been set with . + /// When a hasn't been set with . /// public void InitPropertiesWindowAndActivate() { Index: Core/Common/src/Core.Common.Gui/Forms/MessageWindow/IMessageWindow.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/MessageWindow/IMessageWindow.cs (.../IMessageWindow.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Forms/MessageWindow/IMessageWindow.cs (.../IMessageWindow.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -42,12 +42,5 @@ /// Clears all messages in the view. /// void Clear(); - - /// - /// Indicates if a given logging-level is enabled or not. - /// - /// The type of logging message to check. - /// true is the particular logging-level is enabled; false otherwise. - bool IsMessageLevelEnabled(Level level); } } \ No newline at end of file Index: Core/Common/src/Core.Common.Gui/Forms/MessageWindow/MessageWindow.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/MessageWindow/MessageWindow.cs (.../MessageWindow.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Forms/MessageWindow/MessageWindow.cs (.../MessageWindow.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -291,24 +291,6 @@ messageWindowData.Clear(); } - public bool IsMessageLevelEnabled(Level level) - { - if (level == Level.Warn && !buttonShowWarning.Checked) - { - return false; - } - if (level == Level.Info && !buttonShowInfo.Checked) - { - return false; - } - if (level == Level.Error && !buttonShowError.Checked) - { - return false; - } - - return true; - } - #endregion } } \ No newline at end of file Index: Core/Common/src/Core.Common.Gui/Forms/MessageWindow/MessageWindowLogAppender.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/MessageWindow/MessageWindowLogAppender.cs (.../MessageWindowLogAppender.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Forms/MessageWindow/MessageWindowLogAppender.cs (.../MessageWindowLogAppender.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -39,10 +39,10 @@ public class MessageWindowLogAppender : AppenderSkeleton { /// - /// This list contains any messages that could not yet be delivered to the - /// (typically because it doesn't exist yet at startup). They are kept in the backlog - /// and send to upon the first message arriving while there is a MessageWindow - /// has been set. + /// This list contains any messages that could not yet be delivered to the + /// (typically because it doesn't exist yet at startup). The messages are kept in the backlog + /// and sent to upon the next message arriving while an + /// instance of has been set. /// private readonly IList messageBackLog = new List(); @@ -80,8 +80,9 @@ } /// - /// Indicating whether this appender should forward it's messages to - /// (set to true) or should cache them when it's enabled at a later time (set to false). + /// Indicates whether this appender should forward its messages to + /// (set to true) or should cache them when for when it's enabled at a later + /// time (set to false). /// public bool Enabled { Index: Core/Common/src/Core.Common.Gui/Forms/Options/OptionsDialog.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/Options/OptionsDialog.cs (.../OptionsDialog.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Forms/Options/OptionsDialog.cs (.../OptionsDialog.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -31,7 +31,7 @@ namespace Core.Common.Gui.Forms.Options { /// - /// Dialog for edition user settings. + /// Dialog for editing user settings. /// public partial class OptionsDialog : DialogBase { Index: Core/Common/src/Core.Common.Gui/Forms/ProgressDialog/ActivityProgressDialogRunner.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/ProgressDialog/ActivityProgressDialogRunner.cs (.../ActivityProgressDialogRunner.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Forms/ProgressDialog/ActivityProgressDialogRunner.cs (.../ActivityProgressDialogRunner.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -43,8 +43,8 @@ /// /// Runs a sequence of activities while showing progress in a dialog. /// - /// The dialog parent. - /// The activities. + /// The dialog parent for which the progress dialog should be shown on top. + /// The activities to be executed. public static void Run(IWin32Window dialogParent, IEnumerable activities) { using (var activityProgressDialog = new ActivityProgressDialog(dialogParent, activities)) Index: Core/Common/src/Core.Common.Gui/Forms/RichTextFile.cs =================================================================== diff -u -r652b03cb8115830641e05bffb356bcf5779bc9f0 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/RichTextFile.cs (.../RichTextFile.cs) (revision 652b03cb8115830641e05bffb356bcf5779bc9f0) +++ Core/Common/src/Core.Common.Gui/Forms/RichTextFile.cs (.../RichTextFile.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -27,12 +27,12 @@ public class RichTextFile { /// - /// The actual title. Can be the file name. + /// Gets or sets the title of the document (can be the file name). /// public string Name { get; set; } /// - /// Path to use for loading the rich-text foramatted file. + /// Gets or sets the file path to use for loading the rich-text formatted file. /// public string FilePath { get; set; } } Index: Core/Common/src/Core.Common.Gui/Forms/RichTextView.cs =================================================================== diff -u -r652b03cb8115830641e05bffb356bcf5779bc9f0 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/RichTextView.cs (.../RichTextView.cs) (revision 652b03cb8115830641e05bffb356bcf5779bc9f0) +++ Core/Common/src/Core.Common.Gui/Forms/RichTextView.cs (.../RichTextView.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -26,12 +26,15 @@ namespace Core.Common.Gui.Forms { /// - /// + /// A view to display a instance. /// public partial class RichTextView : UserControl, IView { private RichTextFile richTextFile; + /// + /// Initializes a new instance of the class. + /// public RichTextView() { InitializeComponent(); Index: Core/Common/src/Core.Common.Gui/Forms/SplashScreen/SplashScreen.xaml.cs =================================================================== diff -u -rc2ea25a7c137c0b98a51734ca53674ddabb5164f -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/SplashScreen/SplashScreen.xaml.cs (.../SplashScreen.xaml.cs) (revision c2ea25a7c137c0b98a51734ca53674ddabb5164f) +++ Core/Common/src/Core.Common.Gui/Forms/SplashScreen/SplashScreen.xaml.cs (.../SplashScreen.xaml.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -59,7 +59,7 @@ } /// - /// Defines if the progress bar and progress label should be visible in the window. + /// Indicates where or not the progress bar and progress label are visible in the window. /// public bool HasProgress { @@ -75,7 +75,7 @@ } /// - /// Version to be shown. + /// Gets or sets the version to be shown. /// public string VersionText { @@ -91,7 +91,7 @@ } /// - /// Copyright owner to be shown. + /// Gets or sets the copyright owner to be shown. /// public string CopyrightText { @@ -107,7 +107,7 @@ } /// - /// Type of the license, plain text. + /// Gets or sets the type of the license, plain text. /// public string LicenseText { @@ -123,7 +123,7 @@ } /// - /// Percentage value to be set as progress indication. + /// Gets or sets the percentage value (in the range [0, 100]) to be set as progress indication. /// public int ProgressValuePercent { @@ -139,7 +139,7 @@ } /// - /// Text, as a current status of the progress. + /// Gets or sets the descriptive text for current status of the progress. /// public string ProgressText { @@ -155,7 +155,7 @@ } /// - /// Text for support e-mail. + /// Gets or sets the support e-mail. /// public string SupportEmail { @@ -171,7 +171,7 @@ } /// - /// Text for support phone number. + /// Gets or sets the support phone number. /// public string SupportPhoneNumber { Index: Core/Common/src/Core.Common.Gui/Forms/ViewManager/AvalonDockDockingManager.cs =================================================================== diff -u -r6ef8fa312a72f486be984ebc3adde4be044811e2 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/ViewManager/AvalonDockDockingManager.cs (.../AvalonDockDockingManager.cs) (revision 6ef8fa312a72f486be984ebc3adde4be044811e2) +++ Core/Common/src/Core.Common.Gui/Forms/ViewManager/AvalonDockDockingManager.cs (.../AvalonDockDockingManager.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -98,50 +98,6 @@ } } - /// - /// Called after layout is changed (e.g. loaded). - /// - public void UpdateLayout() - { - var existingContents = dockingManager.Layout.Descendents().OfType().ToArray(); - var existingHostControls = existingContents.Select(c => c.Content as WindowsFormsHost); - - foreach (var view in views.ToArray()) - { - if (existingHostControls.Any(c => c != null && c.Child == view)) - { - continue; - } - - // view removed - var index = views.IndexOf(view); - var control = view as Control; - if (control != null) - { - control.TextChanged -= ControlOnTextChanged; - } - - view.Dispose(); - view.Data = null; - views.RemoveAt(index); - hostControls.RemoveAt(index); - - if (views.Count != hostControls.Count) - { - throw new InvalidOperationException(); - } - } - - // subscribe to anchorables (this must be much simpler) - var anchorables = dockingManager.Layout.Descendents().OfType().ToArray(); - - foreach (var layoutAnchorable in anchorables) - { - layoutAnchorable.PropertyChanged -= AnchorableOnPropertyChanged; - layoutAnchorable.PropertyChanged += AnchorableOnPropertyChanged; - } - } - public void Dispose() {} public void Add(IView view, ViewLocation location) Index: Core/Common/src/Core.Common.Gui/Forms/ViewManager/DockTabClosingEventArgs.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/ViewManager/DockTabClosingEventArgs.cs (.../DockTabClosingEventArgs.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Forms/ViewManager/DockTabClosingEventArgs.cs (.../DockTabClosingEventArgs.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -30,12 +30,12 @@ public class DockTabClosingEventArgs : EventArgs { /// - /// View trying to close (because a tab is being closed). + /// Gets or sets the view trying to close (because a tab is being closed). /// public IView View { get; set; } /// - /// Specifies if the close action should be cancelled. + /// Indicates if the close action should be cancelled. /// public bool Cancel { get; set; } } Index: Core/Common/src/Core.Common.Gui/Forms/ViewManager/IDockingManager.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/ViewManager/IDockingManager.cs (.../IDockingManager.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Forms/ViewManager/IDockingManager.cs (.../IDockingManager.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -28,56 +28,64 @@ namespace Core.Common.Gui.Forms.ViewManager { /// - /// Interface providing view docking control. + /// Interface for objects controlling view docking behavior. /// public interface IDockingManager : IDisposable { /// - /// Occurs when the bar of a view trying to close. + /// Occurs when the docking-bar of a view trying to close. /// event EventHandler ViewBarClosing; /// - /// Occurs when a view got activated by clicked or entering it otherways + /// Occurs when a view has been activated. /// event EventHandler ViewActivated; + /// + /// Occurs when a 'mouse down' event occurs on the docking control. + /// event Action ViewSelectionMouseDown; + /// + /// Gets the views that are available within the docking control. + /// IEnumerable Views { get; } /// - /// Adds view at specified location + /// Adds the view at specified docking location. /// - /// View to add - /// Location of the view + /// View to add. + /// Location of the view. void Add(IView view, ViewLocation location); /// - /// Removes view and container from bars. If bar is empty it is also removed + /// Removes the view from docking-bars. If the docking-bar is empty, it is also removed. /// - /// - /// + /// View to remove. + /// When set to true, the docking-bar + /// that hosts is closed. Otherwise only the view is removed + /// from the docking-bar. void Remove(IView view, bool removeTabFromDockingbar); /// - /// Sets the tooltip of the container of the view + /// Sets the tooltip of the container corresponding to the view. /// - /// - /// + /// A view added to the docking control. + /// The tooltip text. void SetToolTip(IView view, string tooltip); /// - /// Sets the image of the container of the view + /// Sets the image of the container corresponding to the view. /// - /// - /// + /// A view added to the docking control. + /// The image. void SetImage(IView view, Image image); /// - /// Activates view. + /// Activates the view. /// - /// + /// The view to activate. void ActivateView(IView view); } } \ No newline at end of file Index: Core/Common/src/Core.Common.Gui/Forms/ViewManager/IViewList.cs =================================================================== diff -u -r295ad67e03b81842c18b7688a4c80ab410ddd6d1 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/ViewManager/IViewList.cs (.../IViewList.cs) (revision 295ad67e03b81842c18b7688a4c80ab410ddd6d1) +++ Core/Common/src/Core.Common.Gui/Forms/ViewManager/IViewList.cs (.../IViewList.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -28,38 +28,6 @@ namespace Core.Common.Gui.Forms.ViewManager { /// - /// Flags on where views can be located. - /// - [Flags] - public enum ViewLocation - { - /// - /// The location reserved for Document Views. - /// - Document = 0x0, - /// - /// Left of the location reserved for Document Views. - /// - Left = 0x1, - /// - /// Right of the location reserved for Document Views. - /// - Right = 0x2, - /// - /// Above the location reserved for Document Views. - /// - Top = 0x4, - /// - /// Below the location reserved for Document Views. - /// - Bottom = 0x8, - /// - /// Floating panel. - /// - Floating = 0x16 - }; - - /// /// Manages currently displayed views. /// public interface IViewList : IList, IDisposable @@ -90,7 +58,7 @@ IView ActiveView { get; set; } /// - /// Returns all views. + /// Gets all views. /// IEnumerable AllViews { get; } @@ -109,7 +77,7 @@ void SetTooltip(IView view, string tooltip); /// - /// Removes all views except + /// Removes all views except . /// /// The view that should be kept open and made the active view. /// If set to null, all views will be closed and will be null. Index: Core/Common/src/Core.Common.Gui/Forms/ViewManager/ViewList.cs =================================================================== diff -u -r295ad67e03b81842c18b7688a4c80ab410ddd6d1 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/ViewManager/ViewList.cs (.../ViewList.cs) (revision 295ad67e03b81842c18b7688a4c80ab410ddd6d1) +++ Core/Common/src/Core.Common.Gui/Forms/ViewManager/ViewList.cs (.../ViewList.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -35,7 +35,7 @@ namespace Core.Common.Gui.Forms.ViewManager { /// - /// ViewList manages all view in a given dock sites. + /// This class provides a concrete implementation of . /// public class ViewList : IViewList { @@ -48,11 +48,10 @@ private IView activeView; /// - /// Initializes a new instance of the class. - /// Instantiates a view manager + /// Initializes a new instance of the class. /// - /// Docking manager to provide adding removing windows - /// Location used if a view is added without a location parameter + /// Docking manager to provide adding/removing windows. + /// Location used if a view is added without a location parameter. public ViewList(IDockingManager dockingManager, ViewLocation? defaultLocation) { this.dockingManager = dockingManager; Index: Core/Common/src/Core.Common.Gui/Forms/ViewManager/ViewLocation.cs =================================================================== diff -u --- Core/Common/src/Core.Common.Gui/Forms/ViewManager/ViewLocation.cs (revision 0) +++ Core/Common/src/Core.Common.Gui/Forms/ViewManager/ViewLocation.cs (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -0,0 +1,36 @@ +using System; + +namespace Core.Common.Gui.Forms.ViewManager +{ + /// + /// Flags on where views can be located. + /// + [Flags] + public enum ViewLocation + { + /// + /// The location reserved for Document Views. + /// + Document = 0x0, + /// + /// Left of the location reserved for Document Views. + /// + Left = 0x1, + /// + /// Right of the location reserved for Document Views. + /// + Right = 0x2, + /// + /// Above the location reserved for Document Views. + /// + Top = 0x4, + /// + /// Below the location reserved for Document Views. + /// + Bottom = 0x8, + /// + /// Floating panel. + /// + Floating = 0x16 + }; +} \ No newline at end of file Index: Core/Common/src/Core.Common.Gui/Forms/ViewManager/ViewResolver.cs =================================================================== diff -u -r6c6c9b6eb17d92348c51b05a7e862c860c3d018a -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Forms/ViewManager/ViewResolver.cs (.../ViewResolver.cs) (revision 6c6c9b6eb17d92348c51b05a7e862c860c3d018a) +++ Core/Common/src/Core.Common.Gui/Forms/ViewManager/ViewResolver.cs (.../ViewResolver.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -34,7 +34,7 @@ namespace Core.Common.Gui.Forms.ViewManager { /// - /// Object responsible for finding a view given some data-object. + /// Class responsible for finding a view given some data-object. /// public class ViewResolver : IViewResolver { @@ -155,9 +155,9 @@ } /// - /// Indicates if the view resolver is opening a view. Can be used to ensure consistency - /// of / logic. Sometimes views - /// are closed while being opened. + /// Gets or sets a value indicating if the view resolver is opening a view. Can be + /// used to ensure consistency of / + /// logic. Sometimes views are closed while being opened. /// internal static bool IsOpeningView { get; private set; } Index: Core/Common/src/Core.Common.Gui/GuiCore.cs =================================================================== diff -u -r8760b8163ab56db9718bdb17715304bc1c7d63a9 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/GuiCore.cs (.../GuiCore.cs) (revision 8760b8163ab56db9718bdb17715304bc1c7d63a9) +++ Core/Common/src/Core.Common.Gui/GuiCore.cs (.../GuiCore.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -85,7 +85,7 @@ /// When any parameter is null. public GuiCore(IMainWindow mainWindow, IStoreProject projectStore, ApplicationCore applicationCore, GuiCoreSettings fixedSettings) { - // error detection code, make sure we use only a single instance of RingtoetsGui at a time + // error detection code, make sure we use only a single instance of GuiCore at a time if (isAlreadyRunningInstanceOfIGui) { isAlreadyRunningInstanceOfIGui = false; // reset to that the consecutive creations won't fail. @@ -123,7 +123,7 @@ viewCommandHandler = new ViewCommandHandler(this, this, this, this); storageCommandHandler = new StorageCommandHandler(projectStore, this, this, this, this, viewCommandHandler); exportImportCommandHandler = new ExportImportCommandHandler(MainWindow, ApplicationCore); - projectCommandsHandler = new ProjectCommandsHandler(this, MainWindow, ApplicationCore, this, this); + projectCommandsHandler = new ProjectCommandHandler(this, MainWindow, ApplicationCore, this, this); WindowsApplication.EnableVisualStyles(); ViewPropertyEditor.ViewCommands = ViewCommands; @@ -511,8 +511,6 @@ { mainWindow.LoadLayout(); - toolWindowViewsDockingManager.UpdateLayout(); - // bug in Fluent ribbon (views removed during load layout are not cleared - no events), synchronize them manually ToolWindowViews.RemoveAllExcept(toolWindowViewsDockingManager.Views.ToArray()); @@ -861,7 +859,7 @@ private ApplicationFeatureCommandHandler applicationFeatureCommands; private readonly ViewCommandHandler viewCommandHandler; - private readonly ProjectCommandsHandler projectCommandsHandler; + private readonly ProjectCommandHandler projectCommandsHandler; private readonly ExportImportCommandHandler exportImportCommandHandler; private StorageCommandHandler storageCommandHandler; Index: Core/Common/src/Core.Common.Gui/IDocumentViewController.cs =================================================================== diff -u -r0ae715fe2b16306e4147fed9749bae67ce186168 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/IDocumentViewController.cs (.../IDocumentViewController.cs) (revision 0ae715fe2b16306e4147fed9749bae67ce186168) +++ Core/Common/src/Core.Common.Gui/IDocumentViewController.cs (.../IDocumentViewController.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -42,7 +42,7 @@ IView ActiveView { get; } /// - /// Gets all document views currently opened in the user interface. + /// Gets all document views currently opened in the user interface. /// IViewList DocumentViews { get; } Index: Core/Common/src/Core.Common.Gui/IGui.cs =================================================================== diff -u -r0ae715fe2b16306e4147fed9749bae67ce186168 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/IGui.cs (.../IGui.cs) (revision 0ae715fe2b16306e4147fed9749bae67ce186168) +++ Core/Common/src/Core.Common.Gui/IGui.cs (.../IGui.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -39,8 +39,8 @@ IMainWindowController, IGuiPluginsHost, IDisposable { /// - /// Object responsible for retrieving the instance - /// for a given data object for the application to use. + /// Gets the object responsible for retrieving the + /// instance for a given data object for the application to use. /// IPropertyResolver PropertyResolver { get; } @@ -50,7 +50,7 @@ ApplicationCore ApplicationCore { get; } /// - /// Gets or sets the current project storage. + /// Gets the current project storage. /// IStoreProject Storage { get; } Index: Core/Common/src/Core.Common.Gui/IGuiPluginsHost.cs =================================================================== diff -u -r0ae715fe2b16306e4147fed9749bae67ce186168 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/IGuiPluginsHost.cs (.../IGuiPluginsHost.cs) (revision 0ae715fe2b16306e4147fed9749bae67ce186168) +++ Core/Common/src/Core.Common.Gui/IGuiPluginsHost.cs (.../IGuiPluginsHost.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -33,7 +33,7 @@ public interface IGuiPluginsHost { /// - /// List of plugins. + /// Gets the list of plugins. /// IList Plugins { get; } Index: Core/Common/src/Core.Common.Gui/IMainWindowController.cs =================================================================== diff -u -r0ae715fe2b16306e4147fed9749bae67ce186168 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/IMainWindowController.cs (.../IMainWindowController.cs) (revision 0ae715fe2b16306e4147fed9749bae67ce186168) +++ Core/Common/src/Core.Common.Gui/IMainWindowController.cs (.../IMainWindowController.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -24,7 +24,7 @@ namespace Core.Common.Gui { /// - /// Interface that declare members that allow for the controlling the main window of + /// Interface that declares members that allow for controlling the main window of /// the application. /// public interface IMainWindowController Index: Core/Common/src/Core.Common.Gui/IToolViewController.cs =================================================================== diff -u -r0ae715fe2b16306e4147fed9749bae67ce186168 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/IToolViewController.cs (.../IToolViewController.cs) (revision 0ae715fe2b16306e4147fed9749bae67ce186168) +++ Core/Common/src/Core.Common.Gui/IToolViewController.cs (.../IToolViewController.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -35,10 +35,10 @@ IViewList ToolWindowViews { get; } /// - /// Checks whether a tool window of type is open. + /// Checks whether a tool view of type is open. /// - /// The type of tool window to check for. - /// true if a tool window of type is open, + /// The type of tool view to check for. + /// true if a tool view of type is open, /// false otherwise. bool IsToolWindowOpen(); Index: Core/Common/src/Core.Common.Gui/Plugin/PropertyInfo.cs =================================================================== diff -u -r67980a5c3c5cb71c185278e849b123e7f92990eb -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Plugin/PropertyInfo.cs (.../PropertyInfo.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb) +++ Core/Common/src/Core.Common.Gui/Plugin/PropertyInfo.cs (.../PropertyInfo.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -31,21 +31,22 @@ public class PropertyInfo { /// - /// The type of the data to create properties for. + /// Gets or sets the type of the data to create properties for. /// public Type DataType { get; set; } /// - /// The type of object properties to create. + /// Gets or sets the type of object properties to create. /// public Type PropertyObjectType { get; set; } /// - /// Optional function, used to determine if a this instance is relevant given a data object. + /// Gets or sets the optional function used to determine if this instance is relevant + /// given a data object. /// /// /// As an example, you could implement this as follows: - /// var propertyInfo = new PropertyInfo < Folder, ModelImplementationFolderProperties} { AdditionalDataCheck = o => GetParent(o) is ModelImplementation }; + /// var propertyInfo = new PropertyInfo < Folder, ModelImplementationFolderProperties > { AdditionalDataCheck = o => GetParent(o) is ModelImplementation }; /// /// /// This property breaks the single responsibility principle; besides and an additional method is @@ -54,8 +55,8 @@ public Func AdditionalDataCheck { get; set; } /// - /// Optional function, that allows a data object to be converted to another data - /// object that should be used for the property object. + /// Gets or sets the optional function that allows a data object to be converted + /// to another data object that should be used as the property object instead. /// /// /// As an example, you could implement this as follows: @@ -64,8 +65,8 @@ public Func GetObjectPropertiesData { get; set; } /// - /// Optional function, that allows for post-creation logic to be executed on the - /// newly create object properties. + /// Gets or sets the optional function that allows for post-creation logic to be + /// executed on the newly created object properties. /// /// /// As an example, you could implement this as follows: @@ -75,14 +76,14 @@ } /// - /// Information for creating object properties + /// Information for creating object properties. /// - /// The type of the object to create object properties for - /// The type of the object properties to create + /// The type of the object to create object properties for. + /// The type of the object properties to create. public class PropertyInfo where TProperty : IObjectProperties { /// - /// The type of the data to create properties for. + /// Gets or sets the type of the data to create properties for. /// public Type DataType { @@ -93,7 +94,7 @@ } /// - /// The type of object properties to create. + /// Gets or sets the type of object properties to create. /// public Type PropertyObjectType { @@ -104,11 +105,12 @@ } /// - /// Optional function, used to determine if a this instance is relevant given a data object. + /// Gets or sets the optional function used to determine if this instance is relevant + /// given a data object. /// /// /// As an example, you could implement this as follows: - /// var propertyInfo = new PropertyInfo < Folder, ModelImplementationFolderProperties} { AdditionalDataCheck = o => GetParent(o) is ModelImplementation }; + /// var propertyInfo = new PropertyInfo < Folder, ModelImplementationFolderProperties > { AdditionalDataCheck = o => GetParent(o) is ModelImplementation }; /// /// /// This property breaks the single responsibility principle; besides and an additional method is @@ -117,8 +119,8 @@ public Func AdditionalDataCheck { get; set; } /// - /// Optional function, that allows a data object to be converted to another data - /// object that should be used for the property object. + /// Gets or sets the optional function that allows a data object to be converted + /// to another data object that should be used as the property object instead. /// /// /// As an example, you could implement this as follows: @@ -127,7 +129,8 @@ public Func GetObjectPropertiesData { get; set; } /// - /// Optional function, that allows for post-creation logic to be executed. + /// Gets or sets the optional function that allows for post-creation logic to be + /// executed on the newly created object properties. /// /// /// As an example, you could implement this as follows: Index: Core/Common/src/Core.Common.Gui/Plugin/ViewInfo.cs =================================================================== diff -u -r67980a5c3c5cb71c185278e849b123e7f92990eb -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Plugin/ViewInfo.cs (.../ViewInfo.cs) (revision 67980a5c3c5cb71c185278e849b123e7f92990eb) +++ Core/Common/src/Core.Common.Gui/Plugin/ViewInfo.cs (.../ViewInfo.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -31,27 +31,27 @@ public class ViewInfo { /// - /// Data type associated with this view info. + /// Gets or sets the data type associated with this view info. /// public Type DataType { get; set; } /// - /// Type of data used for the view. + /// Gets or sets the type of data used for the view. /// public Type ViewDataType { get; set; } /// - /// Type of the view. + /// Gets or sets the type of the view. /// public Type ViewType { get; set; } /// - /// Description of the view. + /// Gets or sets the description of the view. /// public string Description { get; set; } /// - /// Method used to determine the name for the view. Function arguments: + /// Gets or sets the method used to determine the name for the view. Function arguments: /// /// The view to get a name for. /// The data of the view. @@ -61,23 +61,23 @@ public Func GetViewName { get; set; } /// - /// Icon of the view. + /// Gets or sets the icon of the view. /// public Image Image { get; set; } /// - /// Optional method, for checking if this view info object can be used for a given - /// data object. Function arguments: + /// Gets or sets the optional method for checking if this view info object can be + /// used for a given data object. Function arguments: /// /// Data for the view. - /// out - true is this view info can be used for the data, or false otherwise. + /// out - true is this view info can be used for the data, or false otherwise. /// /// public Func AdditionalDataCheck { get; set; } /// - /// Optional method, used to convert data from type defined by - /// to type defined by . Function Arguments: + /// Gets or sets the optional method used to convert data from the type defined by + /// to the type defined by . Function Arguments: /// /// Original data. /// out - The converted data to be used in the view. @@ -86,8 +86,8 @@ public Func GetViewData { get; set; } /// - /// Optional method, to perform additional actions after the view has been created. - /// Function arguments: + /// Gets or sets the optional method that performs additional actions after the + /// view has been created. Function arguments: /// /// The created view instance. /// The data corresponding to this view info. @@ -96,8 +96,8 @@ public Action AfterCreate { get; set; } /// - /// Optional method, to allow for extra actions to be performed after the view has - /// received focus. Function arguments: + /// Gets or sets the optional method that allow for extra actions to be performed + /// after the view has received focus. Function arguments: /// /// View to modify. /// Data for this view info. @@ -106,12 +106,12 @@ public Action OnActivateView { get; set; } /// - /// Optional method, such that actions can be performed or checked to see if the - /// view should be closed. Function arguments: + /// Gets or sets the optional method that allows for actions to be performed to + /// see if the view should be closed. Function arguments: /// /// View to close. /// Data of the view. - /// out - true is the closing action was successful, false otherwise. + /// out - true if the closing action was successful, false otherwise. /// /// public Func CloseForData { get; set; } @@ -131,7 +131,7 @@ public class ViewInfo where TView : IView { /// - /// Data type associated with this view info. + /// Gets or sets the data type associated with this view info. /// public Type DataType { @@ -142,7 +142,7 @@ } /// - /// Type of data used for the view. + /// Gets or sets the type of data used for the view. /// public Type ViewDataType { @@ -153,7 +153,7 @@ } /// - /// Type of the view. + /// Gets or sets the type of the view. /// public Type ViewType { @@ -164,12 +164,12 @@ } /// - /// Description of the view. + /// Gets or sets the description of the view. /// public string Description { get; set; } /// - /// Method used to determine the name for the view. Function arguments: + /// Gets or sets the method used to determine the name for the view. Function arguments: /// /// The view to get a name for. /// The data of the view. @@ -179,23 +179,23 @@ public Func GetViewName { get; set; } /// - /// Icon of the view. + /// Gets or sets the icon of the view. /// public Image Image { get; set; } /// - /// Optional method, for checking if this view info object can be used for a given - /// data object. Function arguments: + /// Gets or sets the optional method for checking if this view info object can be + /// used for a given data object. Function arguments: /// /// Data for the view. - /// out - true is this view info can be used for the data, or false otherwise. + /// out - true is this view info can be used for the data, or false otherwise. /// /// public Func AdditionalDataCheck { get; set; } /// - /// Optional method, used to convert data from type defined by - /// to type defined by . Function Arguments: + /// Gets or sets the optional method used to convert data from the type defined by + /// to the type defined by . Function Arguments: /// /// Original data. /// out - The converted data to be used in the view. @@ -204,8 +204,8 @@ public Func GetViewData { get; set; } /// - /// Optional method, to perform additional actions after the view has been created. - /// Function arguments: + /// Gets or sets the optional method that performs additional actions after the + /// view has been created. Function arguments: /// /// The created view instance. /// The data corresponding to this view info. @@ -214,8 +214,8 @@ public Action AfterCreate { get; set; } /// - /// Optional method, to allow for extra actions to be performed after the view has - /// received focus. Function arguments: + /// Gets or sets the optional method that allow for extra actions to be performed + /// after the view has received focus. Function arguments: /// /// View to modify. /// Data for this view info. @@ -224,12 +224,12 @@ public Action OnActivateView { get; set; } /// - /// Optional method, such that actions can be performed or checked to see if the - /// view should be closed. Function arguments: + /// Gets or sets the optional method that allows for actions to be performed to + /// see if the view should be closed. Function arguments: /// /// View to close. /// Data of the view. - /// out - true is the closing action was successful, false otherwise. + /// out - true if the closing action was successful, false otherwise. /// /// public Func CloseForData { get; set; } Index: Core/Common/src/Core.Common.Gui/Properties/Resources.Designer.cs =================================================================== diff -u -rdc41fb966f99f5200c570d70e16397087ffa87c8 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision dc41fb966f99f5200c570d70e16397087ffa87c8) +++ Core/Common/src/Core.Common.Gui/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -1490,15 +1490,6 @@ } /// - /// Looks up a localized string similar to Ringtoetsproject (*.rtd)|*.rtd. - /// - public static string Ringtoets_project_file_filter { - get { - return ResourceManager.GetString("Ringtoets_project_file_filter", resourceCulture); - } - } - - /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// public static System.Drawing.Bitmap SaveAsHH { Index: Core/Common/src/Core.Common.Gui/Properties/Resources.resx =================================================================== diff -u -rdc41fb966f99f5200c570d70e16397087ffa87c8 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Properties/Resources.resx (.../Resources.resx) (revision dc41fb966f99f5200c570d70e16397087ffa87c8) +++ Core/Common/src/Core.Common.Gui/Properties/Resources.resx (.../Resources.resx) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -145,9 +145,6 @@ ..\Resources\ClosePreviewHH.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Ringtoetsproject (*.rtd)|*.rtd - Fout bij het opslaan van de instellingen in {0}. Index: Core/Common/src/Core.Common.Gui/PropertyBag/DynamicPropertyBag.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/PropertyBag/DynamicPropertyBag.cs (.../DynamicPropertyBag.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/PropertyBag/DynamicPropertyBag.cs (.../DynamicPropertyBag.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -66,7 +66,7 @@ public ICollection Properties { get; private set; } /// - /// Gets the object wrapped inside this + /// Gets the object wrapped inside this . /// public object WrappedObject { get; private set; } Index: Core/Common/src/Core.Common.Gui/PropertyBag/IObjectProperties.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/PropertyBag/IObjectProperties.cs (.../IObjectProperties.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/PropertyBag/IObjectProperties.cs (.../IObjectProperties.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -22,12 +22,12 @@ namespace Core.Common.Gui.PropertyBag { /// - /// Interface for object properties + /// Interface for object properties. /// public interface IObjectProperties { /// - /// The data of the object properties + /// Gets or sets the data of the object properties. /// object Data { get; set; } } Index: Core/Common/src/Core.Common.Gui/PropertyBag/PropertySpec.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/PropertyBag/PropertySpec.cs (.../PropertySpec.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/PropertyBag/PropertySpec.cs (.../PropertySpec.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -35,7 +35,7 @@ public class PropertySpec { private static readonly ILog log = LogManager.GetLogger(typeof(PropertySpec)); - private readonly System.Reflection.PropertyInfo propertyInfo; + private readonly PropertyInfo propertyInfo; /// /// Initializes a new instance of the class for a given @@ -89,7 +89,6 @@ /// When /// /// Represented property is an index-property. - /// Property setter is not available. /// does not match the target type. /// Property is an instance property but is null. /// is of incorrect type. @@ -136,7 +135,6 @@ /// When /// /// Represented property is an index-property. - /// Property getter is not available. /// does not match the target type. /// Property is an instance property but is null. /// An error occurred while setting the property value. The @@ -173,8 +171,8 @@ /// Determines whether the captured property is decorated with /// that is configured to use . /// - /// Returns true if a is declared using - /// , false if no match has been found or when + /// Returns true if a is declared using + /// , false if no match has been found or when /// the type converter inherits from . /// Custom implementations of is /// likely to have behavior that Core.Common.Gui namespace cannot account for. As Fisheye: Tag ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Gui/Selection/ItemEventArgs.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Common/src/Core.Common.Gui/Selection/SelectedItemChangedEventArgs.cs =================================================================== diff -u --- Core/Common/src/Core.Common.Gui/Selection/SelectedItemChangedEventArgs.cs (revision 0) +++ Core/Common/src/Core.Common.Gui/Selection/SelectedItemChangedEventArgs.cs (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -0,0 +1,45 @@ +// 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; + +namespace Core.Common.Gui.Selection +{ + /// + /// Event arguments used when notifying selection changes on application level. + /// + public class SelectedItemChangedEventArgs : EventArgs + { + /// + /// Initializes a new instance of the class. + /// + /// The newly selected object. + public SelectedItemChangedEventArgs(object item) + { + Item = item; + } + + /// + /// Gets the item that has been selected. + /// + public object Item { get; private set; } + } +} \ No newline at end of file Index: Core/Common/src/Core.Common.Gui/Settings/GuiCoreSettings.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Settings/GuiCoreSettings.cs (.../GuiCoreSettings.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Settings/GuiCoreSettings.cs (.../GuiCoreSettings.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -27,42 +27,42 @@ public class GuiCoreSettings { /// - /// The start page url to use in the graphical user interface. + /// Gets or sets the start page url to use in the graphical user interface. /// public string StartPageUrl { get; set; } /// - /// The support email address to show in the graphical user interface. + /// Gets or sets the support email address to show in the graphical user interface. /// public string SupportEmailAddress { get; set; } /// - /// The support phone number to show in the graphical user interface. + /// Gets or sets the support phone number to show in the graphical user interface. /// public string SupportPhoneNumber { get; set; } /// - /// The copyright to show in the graphical user interface. + /// Gets or sets the copyright to show in the graphical user interface. /// public string Copyright { get; set; } /// - /// The license description to show in the graphical user interface. + /// Gets or sets the license description to show in the graphical user interface. /// public string LicenseDescription { get; set; } /// - /// The title to show in the main window of the graphical user interface. + /// Gets or sets the title to show in the main window of the graphical user interface. /// public string MainWindowTitle { get; set; } /// - /// The path of the license file to use in the graphical interface. + /// Gets or sets the path of the license file to use in the graphical interface. /// public string LicenseFilePath { get; set; } /// - /// The path of the manual file to use in the graphical interface. + /// Gets or sets the path of the manual file to use in the graphical interface. /// public string ManualFilePath { get; set; } } Index: Core/Common/src/Core.Common.Gui/Settings/SettingsHelper.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Settings/SettingsHelper.cs (.../SettingsHelper.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Settings/SettingsHelper.cs (.../SettingsHelper.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -27,8 +27,14 @@ namespace Core.Common.Gui.Settings { + /// + /// Class that defines helper methods related to user settings. + /// public static class SettingsHelper { + /// + /// Initializes the static properties. + /// static SettingsHelper() { //set defaults based on executing assembly @@ -38,12 +44,25 @@ ApplicationCompany = info.Company; } + /// + /// Gets the name of the application. + /// public static string ApplicationName { get; private set; } + /// + /// Gets the version of the application. + /// public static string ApplicationVersion { get; private set; } + /// + /// Gets the company that released the application. + /// public static string ApplicationCompany { get; private set; } + /// + /// Gets the application local user settings directory. + /// + /// Directory path to where the user settings can be found public static string GetApplicationLocalUserSettingsDirectory() { var localSettingsDirectoryPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); Index: Core/Common/src/Core.Common.Gui/Theme/ColorTheme.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/Theme/ColorTheme.cs (.../ColorTheme.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Gui/Theme/ColorTheme.cs (.../ColorTheme.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -22,7 +22,7 @@ namespace Core.Common.Gui.Theme { /// - /// Enumeration for the all the possible color themes in the application. + /// Enumeration for all the possible color themes in the application. /// public enum ColorTheme { Index: Core/Common/src/Core.Common.Gui/ViewPropertyEditor.cs =================================================================== diff -u -r0ae715fe2b16306e4147fed9749bae67ce186168 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/src/Core.Common.Gui/ViewPropertyEditor.cs (.../ViewPropertyEditor.cs) (revision 0ae715fe2b16306e4147fed9749bae67ce186168) +++ Core/Common/src/Core.Common.Gui/ViewPropertyEditor.cs (.../ViewPropertyEditor.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -30,13 +30,13 @@ { /// /// - /// Use this type in combination with the Editor Attribute on properties in property classes which you want to - /// edit with a Ringtoets view. + /// Use this type in combination with on properties in + /// property classes which you want to edit with a view. /// /// - /// The property grid will display an ellipsis button (...). Clicking on the button will open the default view - /// for the data object in the central tabbed document area of Ringtoets. The view will remain open until - /// closed by the user and is not modal. + /// The property grid will display an ellipsis button (...). Clicking on the button + /// will open the default view for the data object in the central tabbed document area + /// of the application. The view will remain open (is not modal) until closed by the user. /// /// /// Index: Core/Common/test/Core.Common.Gui.Test/Commands/ProjectCommandHandlerTest.cs =================================================================== diff -u --- Core/Common/test/Core.Common.Gui.Test/Commands/ProjectCommandHandlerTest.cs (revision 0) +++ Core/Common/test/Core.Common.Gui.Test/Commands/ProjectCommandHandlerTest.cs (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -0,0 +1,50 @@ +using System.Windows.Forms; + +using Core.Common.Base; +using Core.Common.Base.Data; +using Core.Common.Base.Plugin; +using Core.Common.Gui.Commands; +using Core.Common.Gui.Selection; + +using NUnit.Framework; + +using Rhino.Mocks; + +namespace Core.Common.Gui.Test.Commands +{ + [TestFixture] + public class ProjectCommandHandlerTest + { + [Test] + public void AddItemToProject_AddToProjectItemsAndNotifyObservers() + { + // Setup + var project = new Project(); + var childData = new object(); + + var mocks = new MockRepository(); + var projectOwner = mocks.Stub(); + projectOwner.Project = project; + + var dialogParent = mocks.Stub(); + var applicationCore = mocks.Stub(); + var applicationSelection = mocks.Stub(); + var documentViewController = mocks.Stub(); + + var observer = mocks.Stub(); + observer.Expect(o => o.UpdateObserver()); + mocks.ReplayAll(); + + project.Attach(observer); + + var commandHandler = new ProjectCommandHandler(projectOwner, dialogParent, applicationCore, applicationSelection, documentViewController); + + // Call + commandHandler.AddItemToProject(childData); + + // Assert + CollectionAssert.Contains(project.Items, childData); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Fisheye: Tag ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.Gui.Test/Commands/ProjectCommandsHandlerTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Common/test/Core.Common.Gui.Test/Commands/StorageCommandHandlerTest.cs =================================================================== diff -u -r791e86bf9004a55178386416eb6a9c545380bd1c -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/Commands/StorageCommandHandlerTest.cs (.../StorageCommandHandlerTest.cs) (revision 791e86bf9004a55178386416eb6a9c545380bd1c) +++ Core/Common/test/Core.Common.Gui.Test/Commands/StorageCommandHandlerTest.cs (.../StorageCommandHandlerTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -270,7 +270,7 @@ } [Test] - public void SaveProject_SavingProjectIsSuccesful_LogSuccesAndReturnTrue() + public void SaveProject_SavingProjectIsSuccessful_LogSuccessAndReturnTrue() { // Setup var project = new Project(""); @@ -442,7 +442,7 @@ } [Test] - public void OpenExistingProject_OpeningProjectWithAlreadyLoaded_SetNewlyLoadedProjectAndReturnTrue() + public void OpenExistingProject_OpeningProjectWithAlreadyLoadedProject_SetNewlyLoadedProjectAndReturnTrue() { // Setup const string fileName = "newProject"; Index: Core/Common/test/Core.Common.Gui.Test/Commands/ViewCommandHandlerTest.cs =================================================================== diff -u -r791e86bf9004a55178386416eb6a9c545380bd1c -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/Commands/ViewCommandHandlerTest.cs (.../ViewCommandHandlerTest.cs) (revision 791e86bf9004a55178386416eb6a9c545380bd1c) +++ Core/Common/test/Core.Common.Gui.Test/Commands/ViewCommandHandlerTest.cs (.../ViewCommandHandlerTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -16,183 +16,6 @@ public class ViewCommandHandlerTest { [Test] - public void GetDataOfActiveView_NoActiveView_ReturnNull() - { - // Setup - var mocks = new MockRepository(); - var viewsList = mocks.Stub(); - viewsList.ActiveView = null; - var documentViewController = mocks.Stub(); - documentViewController.Stub(c => c.DocumentViews).Return(viewsList); - var toolViewController = mocks.Stub(); - var applicationSelection = mocks.Stub(); - var guiPluginsHost = mocks.Stub(); - mocks.ReplayAll(); - - var commandHandler = new ViewCommandHandler(documentViewController, toolViewController, - applicationSelection, guiPluginsHost); - - // Call - var viewData = commandHandler.GetDataOfActiveView(); - - // Assert - Assert.IsNull(viewData); - mocks.VerifyAll(); - } - - [Test] - public void GetDataOfActiveView_HasActiveView_ReturnViewData() - { - // Setup - var viewData = new object(); - - var mocks = new MockRepository(); - var activeView = mocks.Stub(); - activeView.Data = viewData; - - var viewsList = mocks.Stub(); - viewsList.ActiveView = activeView; - var documentViewController = mocks.Stub(); - documentViewController.Stub(c => c.DocumentViews).Return(viewsList); - var toolViewController = mocks.Stub(); - var applicationSelection = mocks.Stub(); - var guiPluginsHost = mocks.Stub(); - mocks.ReplayAll(); - - var commandHandler = new ViewCommandHandler(documentViewController, toolViewController, - applicationSelection, guiPluginsHost); - - // Call - var returnedViewData = commandHandler.GetDataOfActiveView(); - - // Assert - Assert.AreSame(viewData, returnedViewData); - mocks.VerifyAll(); - } - - [Test] - public void CanOpenSelectViewDialog_NoSelection_ReturnFalse() - { - // Setup - var mocks = new MockRepository(); - var documentViewController = mocks.Stub(); - var toolViewController = mocks.Stub(); - var applicationSelection = mocks.Stub(); - applicationSelection.Selection = null; - var guiPluginsHost = mocks.Stub(); - mocks.ReplayAll(); - - var commandHandler = new ViewCommandHandler(documentViewController, toolViewController, - applicationSelection, guiPluginsHost); - - // Call - var result = commandHandler.CanOpenSelectViewDialog(); - - // Assert - Assert.IsFalse(result); - mocks.VerifyAll(); - } - - [Test] - [TestCase(0)] - [TestCase(1)] - public void CanOpenSelectViewDialog_LessThenTwoViews_ReturnFalse(int numberOfViewsForSelection) - { - // Setup - var viewInfos = new ViewInfo[numberOfViewsForSelection]; - for (int i = 0; i < viewInfos.Length; i++) - { - viewInfos[i] = new ViewInfo(); - } - - var selectedObject = new object(); - - var mocks = new MockRepository(); - var viewResolver = mocks.Stub(); - viewResolver.Expect(r => r.GetViewInfosFor(selectedObject)).Return(viewInfos); - var documentViewController = mocks.Stub(); - documentViewController.Expect(c => c.DocumentViewsResolver).Return(viewResolver); - var toolViewController = mocks.Stub(); - var applicationSelection = mocks.Stub(); - applicationSelection.Selection = selectedObject; - var guiPluginsHost = mocks.Stub(); - mocks.ReplayAll(); - - var commandHandler = new ViewCommandHandler(documentViewController, toolViewController, - applicationSelection, guiPluginsHost); - - // Call - var result = commandHandler.CanOpenSelectViewDialog(); - - // Assert - Assert.IsFalse(result); - mocks.VerifyAll(); - } - - [Test] - [TestCase(2)] - [TestCase(12)] - public void CanOpenSelectViewDialog_MoreThenOneView_ReturnTrue(int numberOfViewsForSelection) - { - // Setup - var viewInfos = new ViewInfo[numberOfViewsForSelection]; - for (int i = 0; i < viewInfos.Length; i++) - { - viewInfos[i] = new ViewInfo(); - } - - var selectedObject = new object(); - - var mocks = new MockRepository(); - var viewResolver = mocks.Stub(); - viewResolver.Expect(r => r.GetViewInfosFor(selectedObject)).Return(viewInfos); - var documentViewController = mocks.Stub(); - documentViewController.Expect(c => c.DocumentViewsResolver).Return(viewResolver); - var toolViewController = mocks.Stub(); - var applicationSelection = mocks.Stub(); - applicationSelection.Selection = selectedObject; - var guiPluginsHost = mocks.Stub(); - mocks.ReplayAll(); - - var commandHandler = new ViewCommandHandler(documentViewController, toolViewController, - applicationSelection, guiPluginsHost); - - // Call - var result = commandHandler.CanOpenSelectViewDialog(); - - // Assert - Assert.IsTrue(result); - mocks.VerifyAll(); - } - - [Test] - public void OpenSelectViewDialog_ForceOpenViewDialogForSelection() - { - // Setup - var selectedObject = new object(); - - var mocks = new MockRepository(); - var viewResolver = mocks.Stub(); - viewResolver.Expect(r => r.OpenViewForData(selectedObject, true)).Return(true); - var documentViewController = mocks.Stub(); - documentViewController.Stub(c => c.DocumentViewsResolver).Return(viewResolver); - var toolViewController = mocks.Stub(); - var applicationSelection = mocks.Stub(); - applicationSelection.Selection = selectedObject; - var guiPluginsHost = mocks.Stub(); - mocks.ReplayAll(); - - var commandHandler = new ViewCommandHandler(documentViewController, toolViewController, - applicationSelection, guiPluginsHost); - - // Call - commandHandler.OpenSelectViewDialog(); - - // Assert - mocks.VerifyAll(); // Expect open view method is called - } - - [Test] public void OpenViewForSelection_OpenViewDialogForSelection() { // Setup @@ -251,7 +74,7 @@ [Test] [TestCase(1)] [TestCase(11)] - public void CanOpenViewFor_NoViewInfosForTarget_ReturnFalse(int numberOfViewDefinitions) + public void CanOpenViewFor_HasViewInfoDefinedForData_ReturnTrue(int numberOfViewDefinitions) { // Setup var viewObject = new object(); Index: Core/Common/test/Core.Common.Gui.Test/ContextMenu/ContextMenuBuilderTest.cs =================================================================== diff -u -rdc41fb966f99f5200c570d70e16397087ffa87c8 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/ContextMenu/ContextMenuBuilderTest.cs (.../ContextMenuBuilderTest.cs) (revision dc41fb966f99f5200c570d70e16397087ffa87c8) +++ Core/Common/test/Core.Common.Gui.Test/ContextMenu/ContextMenuBuilderTest.cs (.../ContextMenuBuilderTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -481,7 +481,7 @@ [Test] [TestCase(1)] [TestCase(10)] - public void AddSeparator_SeperatorsAddedInBetweenItems_OneSeparatorAdded(int count) + public void AddSeparator_SeparatorsAddedInBetweenItems_OneSeparatorAdded(int count) { // Setup var applicationFeatureCommandsMock = mocks.StrictMock(); Index: Core/Common/test/Core.Common.Gui.Test/ContextMenu/GuiContextMenuItemFactoryTest.cs =================================================================== diff -u -rdc41fb966f99f5200c570d70e16397087ffa87c8 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/ContextMenu/GuiContextMenuItemFactoryTest.cs (.../GuiContextMenuItemFactoryTest.cs) (revision dc41fb966f99f5200c570d70e16397087ffa87c8) +++ Core/Common/test/Core.Common.Gui.Test/ContextMenu/GuiContextMenuItemFactoryTest.cs (.../GuiContextMenuItemFactoryTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -32,7 +32,7 @@ } [Test] - public void Constructor_WithoutTreeNode_ThrowsArgumentNullException() + public void Constructor_WithoutDataObject_ThrowsArgumentNullException() { // Setup var applicationFeatureCommandHandler = mocks.StrictMock(); @@ -108,21 +108,41 @@ } [Test] - [TestCase(true)] - [TestCase(false)] - public void CreateOpenItem_Always_Disabled(bool hasViewersForNodeData) + public void CreateOpenItem_NoDataAvailableForView_MenuItemIsDisabled() { // Setup var commandHandlerMock = mocks.StrictMock(); var exportImportCommandHandlerMock = mocks.StrictMock(); var viewCommandsMock = mocks.StrictMock(); var nodeData = new object(); - viewCommandsMock.Expect(ch => ch.CanOpenViewFor(nodeData)).Return(hasViewersForNodeData); - if (hasViewersForNodeData) - { - viewCommandsMock.Expect(ch => ch.OpenView(nodeData)); - } + viewCommandsMock.Expect(ch => ch.CanOpenViewFor(nodeData)).Return(false); + mocks.ReplayAll(); + var contextMenuFactory = new GuiContextMenuItemFactory(commandHandlerMock, exportImportCommandHandlerMock, viewCommandsMock, nodeData); + + // Call + var item = contextMenuFactory.CreateOpenItem(); + item.PerformClick(); + + // Assert + Assert.AreEqual(Resources.Open, item.Text); + Assert.AreEqual(Resources.Open_ToolTip, item.ToolTipText); + TestHelper.AssertImagesAreEqual(Resources.OpenIcon, item.Image); + Assert.IsFalse(item.Enabled); + + mocks.VerifyAll(); + } + + [Test] + public void CreateOpenItem_HasViewForData_MenuItemEnabledAndCausesViewToOpenWhenClicked() + { + // Setup + var commandHandlerMock = mocks.StrictMock(); + var exportImportCommandHandlerMock = mocks.StrictMock(); + var viewCommandsMock = mocks.StrictMock(); + var nodeData = new object(); + viewCommandsMock.Expect(ch => ch.CanOpenViewFor(nodeData)).Return(true); + viewCommandsMock.Expect(ch => ch.OpenView(nodeData)); mocks.ReplayAll(); var contextMenuFactory = new GuiContextMenuItemFactory(commandHandlerMock, exportImportCommandHandlerMock, viewCommandsMock, nodeData); @@ -135,7 +155,7 @@ Assert.AreEqual(Resources.Open, item.Text); Assert.AreEqual(Resources.Open_ToolTip, item.ToolTipText); TestHelper.AssertImagesAreEqual(Resources.OpenIcon, item.Image); - Assert.AreEqual(hasViewersForNodeData, item.Enabled); + Assert.IsTrue(item.Enabled); mocks.VerifyAll(); } Index: Core/Common/test/Core.Common.Gui.Test/ContextMenu/TreeViewContextMenuItemFactoryTest.cs =================================================================== diff -u -rd03f2b52982110a0f804adfefe73f86551c59e62 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/ContextMenu/TreeViewContextMenuItemFactoryTest.cs (.../TreeViewContextMenuItemFactoryTest.cs) (revision d03f2b52982110a0f804adfefe73f86551c59e62) +++ Core/Common/test/Core.Common.Gui.Test/ContextMenu/TreeViewContextMenuItemFactoryTest.cs (.../TreeViewContextMenuItemFactoryTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -21,7 +21,7 @@ } [Test] - public void Constructor_WithoutTreeNode_ThrowsArgumentNullException() + public void Constructor_WithoutDataObject_ThrowsArgumentNullException() { // Setup var treeViewControlMock = mocks.StrictMock(); @@ -48,7 +48,7 @@ } [Test] - public void Constructor_WithDataObject_DoesNotThrow() + public void Constructor_WithAllInput_DoesNotThrow() { // Setup var treeViewControlMock = mocks.StrictMock(); @@ -157,7 +157,7 @@ [Test] [TestCase(true)] [TestCase(false)] - public void CreateExpandAllItem_DependingOnChildNodes_ItemWithExpandFunctionWillBeEnabled(bool hasChildren) + public void CreateExpandAllItem_DependingOnCanExpandOrCollapseForData_ItemWithExpandFunctionWillBeEnabled(bool hasChildren) { // Setup var dataObject = "string"; @@ -195,7 +195,7 @@ [Test] [TestCase(true)] [TestCase(false)] - public void CreateCollapseAllItem_DependingOnChildNodes_ItemWithCollapseFunctionWillBeEnabled(bool hasChildren) + public void CreateCollapseAllItem_DependingOnCanExpandOrCollapseForData_ItemWithCollapseFunctionWillBeEnabled(bool hasChildren) { // Setup var dataObject = "string"; Index: Core/Common/test/Core.Common.Gui.Test/Converters/ExpandableArrayConverterTest.cs =================================================================== diff -u -rce50b65f662bcccb1849444e4d51549731131234 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/Converters/ExpandableArrayConverterTest.cs (.../ExpandableArrayConverterTest.cs) (revision ce50b65f662bcccb1849444e4d51549731131234) +++ Core/Common/test/Core.Common.Gui.Test/Converters/ExpandableArrayConverterTest.cs (.../ExpandableArrayConverterTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -14,8 +14,6 @@ [Test] public void DefaultConstructor_ExpectedValues() { - // Setup - // Call var converter = new ExpandableArrayConverter(); @@ -51,7 +49,7 @@ } [Test] - public void ConvertTo_FromArrayToInt_ThrowsInvalidOperationException() + public void ConvertTo_FromArrayToInt_ThrowsNotSupportedException() { // Setup var sourceArray = new int[1]; @@ -65,7 +63,7 @@ } [Test] - public void ConvertTo_FromArrayToString_ReturnCountText() + public void ConvertTo_FromArrayToNull_ThrowsArgumentNullException() { // Setup var sourceArray = new int[2]; Index: Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj =================================================================== diff -u -r6ef8fa312a72f486be984ebc3adde4be044811e2 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj (.../Core.Common.Gui.Test.csproj) (revision 6ef8fa312a72f486be984ebc3adde4be044811e2) +++ Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj (.../Core.Common.Gui.Test.csproj) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -101,7 +101,7 @@ - + Index: Core/Common/test/Core.Common.Gui.Test/Forms/MessageWindow/MessageWindowLogAppenderTest.cs =================================================================== diff -u -r7be78fc1e46d0ed724079cd60c80c3bdca239305 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/Forms/MessageWindow/MessageWindowLogAppenderTest.cs (.../MessageWindowLogAppenderTest.cs) (revision 7be78fc1e46d0ed724079cd60c80c3bdca239305) +++ Core/Common/test/Core.Common.Gui.Test/Forms/MessageWindow/MessageWindowLogAppenderTest.cs (.../MessageWindowLogAppenderTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -186,7 +186,7 @@ } [Test] - public void DoAppend_LogMessagetHasException_AppendTextForReferToLogfileToMessage() + public void DoAppend_LogMessageHasException_AppendTextForReferToLogfileToMessage() { // Setup const string messageText = ""; Index: Core/Common/test/Core.Common.Gui.Test/Forms/PropertyGridView/PropertyResolverTest.cs =================================================================== diff -u -r0358065f73923af6b8ca6566ee1e210c78c55e44 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/Forms/PropertyGridView/PropertyResolverTest.cs (.../PropertyResolverTest.cs) (revision 0358065f73923af6b8ca6566ee1e210c78c55e44) +++ Core/Common/test/Core.Common.Gui.Test/Forms/PropertyGridView/PropertyResolverTest.cs (.../PropertyResolverTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -324,7 +324,7 @@ Assert.IsNull(result); } - #region Nester Types: various test-case classes + #region Nested Types: various test-case classes private class A { Index: Core/Common/test/Core.Common.Gui.Test/Forms/RichTextFileTest.cs =================================================================== diff -u -r652b03cb8115830641e05bffb356bcf5779bc9f0 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/Forms/RichTextFileTest.cs (.../RichTextFileTest.cs) (revision 652b03cb8115830641e05bffb356bcf5779bc9f0) +++ Core/Common/test/Core.Common.Gui.Test/Forms/RichTextFileTest.cs (.../RichTextFileTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -10,8 +10,6 @@ [Test] public void DefaultConstructor_ExpectedValues() { - // Setup - // Call var file = new RichTextFile(); Index: Core/Common/test/Core.Common.Gui.Test/Forms/SplashScreen/SplashScreenTest.cs =================================================================== diff -u -rc2ea25a7c137c0b98a51734ca53674ddabb5164f -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/Forms/SplashScreen/SplashScreenTest.cs (.../SplashScreenTest.cs) (revision c2ea25a7c137c0b98a51734ca53674ddabb5164f) +++ Core/Common/test/Core.Common.Gui.Test/Forms/SplashScreen/SplashScreenTest.cs (.../SplashScreenTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -11,7 +11,7 @@ { [Test] [RequiresSTA] - public void Shutdown_SlashShown_ShouldBeClosed() + public void Shutdown_SlashScreenShown_ShouldBeClosed() { // Setup var screen = new Gui.Forms.SplashScreen.SplashScreen(); @@ -98,11 +98,13 @@ [Test] [RequiresSTA] - public void TestProgressBarVisible() + public void HasProgress_SetToFalse_HideProgressBarRelatedUserInterfaceElements() { // Setup var screen = new Gui.Forms.SplashScreen.SplashScreen(); screen.Show(); + + // Precondition: Assert.IsTrue(screen.HasProgress, "Initially, the progress should be visible"); Assert.IsTrue(GetIsControlVisible(screen, "ProgressBar")); Assert.IsTrue(GetIsControlVisible(screen, "LabelProgressMessage")); Index: Core/Common/test/Core.Common.Gui.Test/Forms/ViewManager/AvalonDockDockingManagerTest.cs =================================================================== diff -u -rd212065881d696420fd33c789c917501e09c7fc0 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/Forms/ViewManager/AvalonDockDockingManagerTest.cs (.../AvalonDockDockingManagerTest.cs) (revision d212065881d696420fd33c789c917501e09c7fc0) +++ Core/Common/test/Core.Common.Gui.Test/Forms/ViewManager/AvalonDockDockingManagerTest.cs (.../AvalonDockDockingManagerTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -15,8 +15,9 @@ { [Test] [RequiresSTA] - public void ViewTextChangedResultsInTabNameChanged() + public void GivenViewDockedAsDocument_WhenViewTextIsChanged_ThenViewContainersTitleChangedToNewViewText() { + // Setup var mocks = new MockRepository(); var dockManager = mocks.Stub(); var view = new TestView(); @@ -29,20 +30,24 @@ var layout = TypeUtils.CallPrivateMethod(dock, "GetLayoutContent", view); + // Precondition Assert.AreEqual("", layout.Title); + + // Call view.Text = @"Test"; + // Assert Assert.AreEqual("Test", layout.Title); } [Test] [RequiresSTA] - public void SwitchingTabCausesOldTabsActiveControlToLoseFocusTools9109() + public void ActivateView_ChangingActiveViewToDifferentDockedView_OldActiveViewActiveControlIsNull() { + // Setup var view = new TestView(); var view2 = new TestView(); - // create an avalon dock/tab with two views var dock = new AvalonDockDockingManager(new DockingManager(), new[] { ViewLocation.Document @@ -51,13 +56,12 @@ dock.Add(view2, ViewLocation.Document); dock.ActivateView(view); - // set a textbox active view.ActiveControl = view.Controls[0]; - // switch to other tab + // Call dock.ActivateView(view2); - // assert the textbox is no longer active + // Assert Assert.IsNull(view.ActiveControl); } } Index: Core/Common/test/Core.Common.Gui.Test/Forms/ViewManager/DockTabClosingEventArgsTest.cs =================================================================== diff -u -r1e9f415cb615bf84526faeecb51f9a70498f9ffc -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/Forms/ViewManager/DockTabClosingEventArgsTest.cs (.../DockTabClosingEventArgsTest.cs) (revision 1e9f415cb615bf84526faeecb51f9a70498f9ffc) +++ Core/Common/test/Core.Common.Gui.Test/Forms/ViewManager/DockTabClosingEventArgsTest.cs (.../DockTabClosingEventArgsTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -13,8 +13,6 @@ [Test] public void DefaultConstructor_ExpectedValues() { - // Setup - // Call var eventArgs = new DockTabClosingEventArgs(); Index: Core/Common/test/Core.Common.Gui.Test/Forms/ViewManager/TestView.cs =================================================================== diff -u -r6c6c9b6eb17d92348c51b05a7e862c860c3d018a -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/Forms/ViewManager/TestView.cs (.../TestView.cs) (revision 6c6c9b6eb17d92348c51b05a7e862c860c3d018a) +++ Core/Common/test/Core.Common.Gui.Test/Forms/ViewManager/TestView.cs (.../TestView.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -15,9 +15,4 @@ } public class TestViewDerivative : TestView {} - - public class TestWrapper - { - public string RealData { get; set; } - } } \ No newline at end of file Index: Core/Common/test/Core.Common.Gui.Test/Forms/ViewManager/ViewListTest.cs =================================================================== diff -u -r295ad67e03b81842c18b7688a4c80ab410ddd6d1 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/Forms/ViewManager/ViewListTest.cs (.../ViewListTest.cs) (revision 295ad67e03b81842c18b7688a4c80ab410ddd6d1) +++ Core/Common/test/Core.Common.Gui.Test/Forms/ViewManager/ViewListTest.cs (.../ViewListTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -653,7 +653,7 @@ } [Test] - public void Contains_ViewNotInList_ReturnTrue() + public void Contains_ViewInList_ReturnTrue() { // Setup var mocks = new MockRepository(); @@ -1137,7 +1137,7 @@ [TestCase(0)] [TestCase(1)] [TestCase(2)] - public void IndexOf_ViewInList_ReturnMinusOne(int expectedViewIndex) + public void IndexOf_ViewInList_ReturnExpectedIndex(int expectedViewIndex) { // Setup var mocks = new MockRepository(); Index: Core/Common/test/Core.Common.Gui.Test/Forms/ViewManager/ViewResolverTest.cs =================================================================== diff -u -r6c6c9b6eb17d92348c51b05a7e862c860c3d018a -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/Forms/ViewManager/ViewResolverTest.cs (.../ViewResolverTest.cs) (revision 6c6c9b6eb17d92348c51b05a7e862c860c3d018a) +++ Core/Common/test/Core.Common.Gui.Test/Forms/ViewManager/ViewResolverTest.cs (.../ViewResolverTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -401,7 +401,7 @@ [Test] [RequiresSTA] - public void OpeningViewForDataTwiceShouldOnlySetActiveView() + public void OpenViewForData_OpeningViewForAlreadyOpenedButInactiveView_ActivateView() { // Setup var url = new WebLink("Deltares", new Uri("http://www.deltares.nl")); Index: Core/Common/test/Core.Common.Gui.Test/GuiCoreTest.cs =================================================================== diff -u -r6ef8fa312a72f486be984ebc3adde4be044811e2 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/GuiCoreTest.cs (.../GuiCoreTest.cs) (revision 6ef8fa312a72f486be984ebc3adde4be044811e2) +++ Core/Common/test/Core.Common.Gui.Test/GuiCoreTest.cs (.../GuiCoreTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -81,7 +81,7 @@ Assert.AreEqual(null, gui.Selection); - Assert.IsInstanceOf(gui.ProjectCommands); + Assert.IsInstanceOf(gui.ProjectCommands); Assert.IsInstanceOf(gui.StorageCommands); Assert.IsInstanceOf(gui.ViewCommands); Assert.AreEqual(null, gui.ApplicationCommands); @@ -762,34 +762,19 @@ [Test] [STAThread] - public void CheckViewPropertyEditorIsInitialized() - { - var mocks = new MockRepository(); - var projectStore = mocks.Stub(); - mocks.ReplayAll(); - - using (new GuiCore(new MainWindow(), projectStore, new ApplicationCore(), new GuiCoreSettings())) - { - Assert.NotNull(ViewPropertyEditor.ViewCommands); - } - mocks.VerifyAll(); - } - - [Test] - [STAThread] public void GetAllDataWithViewDefinitionsRecursively_DataHasNoViewDefinitions_ReturnEmpty() { // Setup var mocks = new MockRepository(); var projectStore = mocks.Stub(); mocks.ReplayAll(); - using (var ringtoetsGui = new GuiCore(new MainWindow(), projectStore, new ApplicationCore(), new GuiCoreSettings())) + using (var gui = new GuiCore(new MainWindow(), projectStore, new ApplicationCore(), new GuiCoreSettings())) { var rootData = new object(); // Call - var dataInstancesWithViewDefinitions = ringtoetsGui.GetAllDataWithViewDefinitionsRecursively(rootData); + var dataInstancesWithViewDefinitions = gui.GetAllDataWithViewDefinitionsRecursively(rootData); // Assert CollectionAssert.IsEmpty(dataInstancesWithViewDefinitions); @@ -823,13 +808,13 @@ plugin2.Stub(p => p.Deactivate()); mocks.ReplayAll(); - using (var ringtoetsGui = new GuiCore(new MainWindow(), projectStore, new ApplicationCore(), new GuiCoreSettings())) + using (var gui = new GuiCore(new MainWindow(), projectStore, new ApplicationCore(), new GuiCoreSettings())) { - ringtoetsGui.Plugins.Add(plugin1); - ringtoetsGui.Plugins.Add(plugin2); + gui.Plugins.Add(plugin1); + gui.Plugins.Add(plugin2); // Call - var dataInstancesWithViewDefinitions = ringtoetsGui.GetAllDataWithViewDefinitionsRecursively(rootData).OfType().ToArray(); + var dataInstancesWithViewDefinitions = gui.GetAllDataWithViewDefinitionsRecursively(rootData).OfType().ToArray(); // Assert var expectedDataDefinitions = new[] @@ -875,13 +860,13 @@ plugin2.Stub(p => p.Deactivate()); mocks.ReplayAll(); - using (var ringtoetsGui = new GuiCore(new MainWindow(), projectStore, new ApplicationCore(), new GuiCoreSettings())) + using (var gui = new GuiCore(new MainWindow(), projectStore, new ApplicationCore(), new GuiCoreSettings())) { - ringtoetsGui.Plugins.Add(plugin1); - ringtoetsGui.Plugins.Add(plugin2); + gui.Plugins.Add(plugin1); + gui.Plugins.Add(plugin2); // Call - var dataInstancesWithViewDefinitions = ringtoetsGui.GetAllDataWithViewDefinitionsRecursively(rootData).OfType().ToArray(); + var dataInstancesWithViewDefinitions = gui.GetAllDataWithViewDefinitionsRecursively(rootData).OfType().ToArray(); // Assert var expectedDataDefinitions = new[] Index: Core/Common/test/Core.Common.Gui.Test/PropertyBag/DynamicPropertyBagTest.cs =================================================================== diff -u -rd7ef66291b1a64881d4e26b8fc30c5f66f16d67a -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/PropertyBag/DynamicPropertyBagTest.cs (.../DynamicPropertyBagTest.cs) (revision d7ef66291b1a64881d4e26b8fc30c5f66f16d67a) +++ Core/Common/test/Core.Common.Gui.Test/PropertyBag/DynamicPropertyBagTest.cs (.../DynamicPropertyBagTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -5,6 +5,7 @@ using Core.Common.Gui.Attributes; using Core.Common.Gui.PropertyBag; +using Core.Common.Utils.Reflection; using NUnit.Framework; @@ -214,31 +215,51 @@ } [Test] - public void DynamicPropertyBagResolvesDynamicVisibleAttributes() + public void GivenObjectPropertiesWithDynamicVisibleProperties_WhenPropertyShown_ThenPropertyShouldBePresentInBag() { + // Setup var propertyObject = new TestProperties { Visible = true }; var dynamicPropertyBag = new DynamicPropertyBag(propertyObject); - var propertyDescriptorCollection = ((ICustomTypeDescriptor) dynamicPropertyBag).GetProperties(new[] + var propertyDescriptorCollection = ((ICustomTypeDescriptor) dynamicPropertyBag).GetProperties(new Attribute[] { new BrowsableAttribute(true) }); - var namePropertyDescriptor = propertyDescriptorCollection.Find("Name", false); - Assert.IsTrue(namePropertyDescriptor.IsBrowsable, "Name should be visible"); + // Call + var dynamicallyVisiblePropertyName = TypeUtils.GetMemberName(tp => tp.Name); + var namePropertyDescriptor = propertyDescriptorCollection.Find(dynamicallyVisiblePropertyName, false); - propertyObject.Visible = false; + // TearDown + Assert.IsTrue(namePropertyDescriptor.IsBrowsable, + string.Format("{0} should be visible", dynamicallyVisiblePropertyName)); + } - propertyDescriptorCollection = ((ICustomTypeDescriptor) dynamicPropertyBag).GetProperties(new[] + [Test] + public void GivenObjectPropertiesWithDynamicVisibleProperties_WhenPropertyHidden_ThenPropertyNotPresentInBag() + { + // Setup + var propertyObject = new TestProperties { + Visible = false + }; + var dynamicPropertyBag = new DynamicPropertyBag(propertyObject); + + var propertyDescriptorCollection = ((ICustomTypeDescriptor)dynamicPropertyBag).GetProperties(new Attribute[] + { new BrowsableAttribute(true) }); - namePropertyDescriptor = propertyDescriptorCollection.Find("Name", false); - Assert.IsNull(namePropertyDescriptor, "Name should not be visible anymore"); + // Call + var dynamicallyVisiblePropertyName = TypeUtils.GetMemberName(tp => tp.Name); + var namePropertyDescriptor = propertyDescriptorCollection.Find(dynamicallyVisiblePropertyName, false); + + // Assert + Assert.IsNull(namePropertyDescriptor, + string.Format("{0} should not be visible anymore", dynamicallyVisiblePropertyName)); } [Test] @@ -266,7 +287,7 @@ } [Test] - public void DynamicPropertyBagWrapsNestedPropertyObjects() + public void GetProperties_PropertyIsDecoratedWithExpandableObjectConverter_WrapPropertyValueInDynamicPropertyBag() { // Setup var subProperties = new TestProperties @@ -279,12 +300,11 @@ }; var dynamicPropertyBag = new DynamicPropertyBag(testProperties); - var propertiesCollection = dynamicPropertyBag.GetProperties(); - // Call - var wrappedValue = propertiesCollection[0].GetValue(dynamicPropertyBag.WrappedObject); - + var propertiesCollection = dynamicPropertyBag.GetProperties(); + // Assert + var wrappedValue = propertiesCollection[0].GetValue(dynamicPropertyBag.WrappedObject); var bag = (DynamicPropertyBag)wrappedValue; Assert.AreSame(subProperties, bag.WrappedObject); } Index: Core/Common/test/Core.Common.Gui.Test/PropertyBag/ObjectPropertiesTest.cs =================================================================== diff -u -r0ae715fe2b16306e4147fed9749bae67ce186168 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/PropertyBag/ObjectPropertiesTest.cs (.../ObjectPropertiesTest.cs) (revision 0ae715fe2b16306e4147fed9749bae67ce186168) +++ Core/Common/test/Core.Common.Gui.Test/PropertyBag/ObjectPropertiesTest.cs (.../ObjectPropertiesTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -38,7 +38,7 @@ } [Test] - public void Data_IsNotBrowseable() + public void Data_IsNotBrowsable() { // Setup var properties = new ObjectProperties(); Index: Core/Common/test/Core.Common.Gui.Test/PropertyBag/PropertySpecTest.cs =================================================================== diff -u -r8de8647e95dd220a1a4d78980e88af32ee9d2d3f -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/PropertyBag/PropertySpecTest.cs (.../PropertySpecTest.cs) (revision 8de8647e95dd220a1a4d78980e88af32ee9d2d3f) +++ Core/Common/test/Core.Common.Gui.Test/PropertyBag/PropertySpecTest.cs (.../PropertySpecTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -166,7 +166,7 @@ } [Test] - public void SetValue_PropertyWithoutPublicGet_ThrowInvalidOperationException() + public void SetValue_PropertyWithoutPublicSet_ThrowInvalidOperationException() { // Setup var target = new ClassWithProperties(); Index: Core/Common/test/Core.Common.Gui.Test/Settings/SettingsHelperTest.cs =================================================================== diff -u -r0ae715fe2b16306e4147fed9749bae67ce186168 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Gui.Test/Settings/SettingsHelperTest.cs (.../SettingsHelperTest.cs) (revision 0ae715fe2b16306e4147fed9749bae67ce186168) +++ Core/Common/test/Core.Common.Gui.Test/Settings/SettingsHelperTest.cs (.../SettingsHelperTest.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -9,7 +9,7 @@ public class SettingsHelperTest { [Test] - public void ApplicationName_ReturnProductNameOfExecutingAssebly() + public void ApplicationName_ReturnProductNameOfExecutingAssembly() { // Call var settings = SettingsHelper.ApplicationName; @@ -19,7 +19,7 @@ } [Test] - public void ApplicationVersion_ReturnVersionOfExecutingAssebly() + public void ApplicationVersion_ReturnVersionOfExecutingAssembly() { // Call var settings = SettingsHelper.ApplicationVersion; @@ -29,7 +29,7 @@ } [Test] - public void ApplicationCompany_ReturnCompanyOfExecutingAssebly() + public void ApplicationCompany_ReturnCompanyOfExecutingAssembly() { // Call var settings = SettingsHelper.ApplicationCompany; Index: Core/Common/test/Core.Common.Integration.Test/Core.Common.Integration.Test.csproj =================================================================== diff -u -r49bebd2cfc2cae266077222234b9bd42ff58e2a8 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Core/Common/test/Core.Common.Integration.Test/Core.Common.Integration.Test.csproj (.../Core.Common.Integration.Test.csproj) (revision 49bebd2cfc2cae266077222234b9bd42ff58e2a8) +++ Core/Common/test/Core.Common.Integration.Test/Core.Common.Integration.Test.csproj (.../Core.Common.Integration.Test.csproj) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -94,7 +94,7 @@ - + Index: Core/Common/test/Core.Common.Integration.Test/Ringtoets/Application.Ringtoets/GuiCoreIntegrationTest.cs =================================================================== diff -u --- Core/Common/test/Core.Common.Integration.Test/Ringtoets/Application.Ringtoets/GuiCoreIntegrationTest.cs (revision 0) +++ Core/Common/test/Core.Common.Integration.Test/Ringtoets/Application.Ringtoets/GuiCoreIntegrationTest.cs (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -0,0 +1,112 @@ +using System.Windows.Controls; + +using Core.Common.Base.Plugin; +using Core.Common.Base.Storage; +using Core.Common.Gui; +using Core.Common.Gui.Forms.MainWindow; +using Core.Common.Gui.Settings; +using Core.Common.TestUtil; +using Core.Plugins.ProjectExplorer; +using NUnit.Framework; + +using Rhino.Mocks; + +using Ringtoets.Integration.Plugin; + +namespace Core.Common.Integration.Test.Ringtoets.Application.Ringtoets +{ + [TestFixture] + public class GuiCoreIntegrationTest + { + [SetUp] + public void SetUp() + { + LogHelper.ResetLogging(); + } + + [Test] + [RequiresSTA] + public void StartGuiWithToolboxDoesNotCrash() + { + var mocks = new MockRepository(); + var projectStore = mocks.Stub(); + mocks.ReplayAll(); + + using (var gui = new GuiCore(new MainWindow(), projectStore, new ApplicationCore(), new GuiCoreSettings())) + { + var applicationCore = gui.ApplicationCore; + + applicationCore.AddPlugin(new RingtoetsApplicationPlugin()); + + gui.Run(); + } + mocks.VerifyAll(); + } + + [Test] + [RequiresSTA] + public void StartWithCommonPluginsShouldBeFast() + { + TestHelper.AssertIsFasterThan(7500, StartWithCommonPlugins); + } + + [Test] + [RequiresSTA] + public void GuiSelectionIsSetToProjectAfterStartWithProjectExplorer() + { + // initialize + var mocks = new MockRepository(); + var projectStore = mocks.Stub(); + mocks.ReplayAll(); + + using (var gui = new GuiCore(new MainWindow(), projectStore, new ApplicationCore(), new GuiCoreSettings())) + { + gui.Plugins.Add(new ProjectExplorerGuiPlugin()); + gui.Run(); + + Assert.AreEqual(gui.Project, gui.Selection); + } + mocks.VerifyAll(); + } + + [Test] + [RequiresSTA] + public void FormActionIsRunForMainWindow() + { + //testing testhelper + visible changed event of mainwindow. + //could be tested separately but the combination is vital to many tests. That's why this test is here. + var mocks = new MockRepository(); + var projectStore = mocks.Stub(); + mocks.ReplayAll(); + + using (var gui = new GuiCore(new MainWindow(), projectStore, new ApplicationCore(), new GuiCoreSettings())) + { + gui.Run(); + int callCount = 0; + WpfTestHelper.ShowModal((Control) gui.MainWindow, () => callCount++); + Assert.AreEqual(1, callCount); + } + mocks.VerifyAll(); + } + + private static void StartWithCommonPlugins() + { + var mocks = new MockRepository(); + var projectStore = mocks.Stub(); + mocks.ReplayAll(); + + using (var gui = new GuiCore(new MainWindow(), projectStore, new ApplicationCore(), new GuiCoreSettings())) + { + var applicationCore = gui.ApplicationCore; + + applicationCore.AddPlugin(new RingtoetsApplicationPlugin()); + gui.Plugins.Add(new ProjectExplorerGuiPlugin()); + + gui.Run(); + + WpfTestHelper.ShowModal((Control) gui.MainWindow); + } + mocks.VerifyAll(); + } + } +} \ No newline at end of file Fisheye: Tag ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.Integration.Test/Ringtoets/Application.Ringtoets/RingtoetsGuiIntegrationTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSectionBase.cs =================================================================== diff -u -r17574077c6720e02c10f23ac3a0354db35855a05 -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSectionBase.cs (.../AssessmentSectionBase.cs) (revision 17574077c6720e02c10f23ac3a0354db35855a05) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSectionBase.cs (.../AssessmentSectionBase.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) @@ -24,10 +24,8 @@ using Core.Common.Base; using Core.Common.Base.Storage; using Ringtoets.Common.Data; -using Ringtoets.Common.Placeholder; using Ringtoets.Integration.Data.Contribution; using Ringtoets.Integration.Data.HydraulicBoundary; -using Ringtoets.Integration.Data.Properties; namespace Ringtoets.Integration.Data {