Index: Core/Common/src/Core.Common.Gui/GuiCommandHandler.cs
===================================================================
diff -u -rf1c02b2d47dc561deec70a24128d8dd49d9bed6a -r4c48f1a98dc77cdb66e4dc3ac80060713e6051a6
--- Core/Common/src/Core.Common.Gui/GuiCommandHandler.cs (.../GuiCommandHandler.cs) (revision f1c02b2d47dc561deec70a24128d8dd49d9bed6a)
+++ Core/Common/src/Core.Common.Gui/GuiCommandHandler.cs (.../GuiCommandHandler.cs) (revision 4c48f1a98dc77cdb66e4dc3ac80060713e6051a6)
@@ -240,12 +240,11 @@
return null;
}
- public object AddNewProjectItem(object parent)
+ public void AddNewProjectItem(object parent)
{
if (gui.Application.Project == null)
{
Log.Error(Resources.GuiCommandHandler_AddNewProjectItem_There_needs_to_be_a_project_to_add_an_item);
- return null;
}
var selectDataDialog = CreateSelectionDialogWithProjectItems(GetSupportedDataItemInfos(parent).ToList());
@@ -259,11 +258,7 @@
gui.Selection = newProjectItem;
OpenViewForSelection();
}
-
- return newProjectItem;
}
-
- return null;
}
///
Index: Core/Common/src/Core.Common.Gui/IGui.cs
===================================================================
diff -u -rb7740a20087463e213caab7a0a6d8d33bdf3f3ef -r4c48f1a98dc77cdb66e4dc3ac80060713e6051a6
--- Core/Common/src/Core.Common.Gui/IGui.cs (.../IGui.cs) (revision b7740a20087463e213caab7a0a6d8d33bdf3f3ef)
+++ Core/Common/src/Core.Common.Gui/IGui.cs (.../IGui.cs) (revision 4c48f1a98dc77cdb66e4dc3ac80060713e6051a6)
@@ -71,13 +71,6 @@
///
object Selection { get; set; }
- ///
- /// Selected project item.
- /// If non-IProjectItem is selected in project tree view then this item must be set from outside
- /// (by a project tree view or any other IProjectItem navigation control).
- ///
- IProjectItem SelectedProjectItem { get; set; }
-
#endregion
#region Public Methods
Index: Core/Common/src/Core.Common.Gui/IGuiCommandHandler.cs
===================================================================
diff -u -r2a90c0c1be6114f72af65c42f0a6f334b30e4755 -r4c48f1a98dc77cdb66e4dc3ac80060713e6051a6
--- Core/Common/src/Core.Common.Gui/IGuiCommandHandler.cs (.../IGuiCommandHandler.cs) (revision 2a90c0c1be6114f72af65c42f0a6f334b30e4755)
+++ Core/Common/src/Core.Common.Gui/IGuiCommandHandler.cs (.../IGuiCommandHandler.cs) (revision 4c48f1a98dc77cdb66e4dc3ac80060713e6051a6)
@@ -69,7 +69,7 @@
/// The predicate which must evaluate to true for an item type to be included in the list
object AddNewChildItem(object parent, IEnumerable childItemTypes);
- object AddNewProjectItem(object parent);
+ void AddNewProjectItem(object parent);
///
///
Index: Core/Common/src/Core.Common.Gui/RingtoetsGui.cs
===================================================================
diff -u -r293be5aa0c9cfb58fea075f0ce6943fdfb310406 -r4c48f1a98dc77cdb66e4dc3ac80060713e6051a6
--- Core/Common/src/Core.Common.Gui/RingtoetsGui.cs (.../RingtoetsGui.cs) (revision 293be5aa0c9cfb58fea075f0ce6943fdfb310406)
+++ Core/Common/src/Core.Common.Gui/RingtoetsGui.cs (.../RingtoetsGui.cs) (revision 4c48f1a98dc77cdb66e4dc3ac80060713e6051a6)
@@ -145,11 +145,6 @@
selection = value;
- if (Selection is IProjectItem && !ReferenceEquals(Selection, SelectedProjectItem))
- {
- SelectedProjectItem = (IProjectItem) Selection;
- }
-
settingSelection = true;
try
@@ -176,11 +171,6 @@
}
}
- ///
- /// TODO: add body to setter and set Selection to a correct item. And vice-versa.
- ///
- public IProjectItem SelectedProjectItem { get; set; }
-
public IList Commands
{
get
@@ -335,7 +325,6 @@
TypeUtils.ClearCaches();
- SelectedProjectItem = null;
Selection = null;
try
Index: Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectTreeView.cs
===================================================================
diff -u -rf1c02b2d47dc561deec70a24128d8dd49d9bed6a -r4c48f1a98dc77cdb66e4dc3ac80060713e6051a6
--- Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectTreeView.cs (.../ProjectTreeView.cs) (revision f1c02b2d47dc561deec70a24128d8dd49d9bed6a)
+++ Core/Plugins/src/Core.Plugins.ProjectExplorer/ProjectTreeView.cs (.../ProjectTreeView.cs) (revision 4c48f1a98dc77cdb66e4dc3ac80060713e6051a6)
@@ -193,8 +193,6 @@
var tag = treeView.SelectedNode != null ? treeView.SelectedNode.Tag : null;
- gui.SelectedProjectItem = tag as IProjectItem;
-
// triggers validate items for ribbon so this should be done after setting SelectedProjectItem
gui.Selection = tag;
@@ -263,12 +261,7 @@
private void buttonsAddNewDataClick(object sender, EventArgs e)
{
- var projectItem = gui.CommandHandler.AddNewProjectItem(gui.SelectedProjectItem);
- if (null != projectItem)
- {
- // TODO: add model name to SelectItemDialog instead
- // treeView.StartLabelEdit();
- }
+ gui.CommandHandler.AddNewProjectItem(gui.Selection);
}
///