Index: /branches/ItemTreeViews/3.3/HeuristicLab.ItemTreeViews.Views-3.3.csproj
===================================================================
--- /branches/ItemTreeViews/3.3/HeuristicLab.ItemTreeViews.Views-3.3.csproj (revision 14335)
+++ /branches/ItemTreeViews/3.3/HeuristicLab.ItemTreeViews.Views-3.3.csproj (revision 14335)
@@ -0,0 +1,199 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {D53E8E48-CFAA-4F57-AC35-63BEF4476159}
+ Library
+ Properties
+ HeuristicLab.ItemTreeViews
+ HeuristicLab.ItemTreeViews.Views-3.3
+ v4.5
+ 512
+
+
+ true
+ full
+ false
+ ..\..\..\trunk\sources\bin\
+ DEBUG;TRACE
+ prompt
+ 4
+ true
+ 5
+
+
+ pdbonly
+ true
+ ..\..\bin\
+ TRACE
+ prompt
+ 4
+
+
+ true
+
+
+
+
+
+
+
+
+
+ true
+ ..\..\bin\
+ CODE_ANALYSIS;DEBUG;TRACE
+ full
+ x64
+ true
+ prompt
+ MinimumRecommendedRules.ruleset
+
+
+ ..\..\bin\
+ TRACE
+ true
+ pdbonly
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+
+
+ true
+ ..\..\bin\
+ CODE_ANALYSIS;DEBUG;TRACE
+ full
+ x86
+ true
+ prompt
+ MinimumRecommendedRules.ruleset
+
+
+ ..\..\bin\
+ TRACE
+ true
+ pdbonly
+ x86
+ prompt
+ MinimumRecommendedRules.ruleset
+
+
+
+ ..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll
+
+
+ False
+ ..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll
+
+
+ False
+ ..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll
+
+
+ ..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll
+
+
+ False
+ ..\..\..\trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll
+
+
+ False
+ ..\..\..\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll
+
+
+ False
+ ..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll
+
+
+ ..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll
+
+
+ False
+ ..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll
+
+
+ False
+ ..\..\..\trunk\sources\bin\HeuristicLab.Tests.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UserControl
+
+
+ ItemCollectionTreeView.cs
+
+
+ UserControl
+
+
+ UserControl
+
+
+ NamedItemCollectionTreeView.cs
+
+
+ UserControl
+
+
+ ParameterCollectionTreeView.cs
+
+
+ UserControl
+
+
+ ParameterizedNamedItemTreeView.cs
+
+
+
+
+
+
+
+
+ ItemCollectionTreeView.cs
+ Designer
+
+
+ ParameterizedNamedItemTreeView.cs
+
+
+
+
+
+ set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+
+
+ export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+
+
+
+
Index: /branches/ItemTreeViews/3.3/HeuristicLab.ItemTreeViews.Views-3.3.sln
===================================================================
--- /branches/ItemTreeViews/3.3/HeuristicLab.ItemTreeViews.Views-3.3.sln (revision 14335)
+++ /branches/ItemTreeViews/3.3/HeuristicLab.ItemTreeViews.Views-3.3.sln (revision 14335)
@@ -0,0 +1,34 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.ItemTreeViews.Views-3.3", "HeuristicLab.ItemTreeViews.Views-3.3.csproj", "{D53E8E48-CFAA-4F57-AC35-63BEF4476159}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {D53E8E48-CFAA-4F57-AC35-63BEF4476159}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D53E8E48-CFAA-4F57-AC35-63BEF4476159}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D53E8E48-CFAA-4F57-AC35-63BEF4476159}.Debug|x64.ActiveCfg = Debug|x64
+ {D53E8E48-CFAA-4F57-AC35-63BEF4476159}.Debug|x64.Build.0 = Debug|x64
+ {D53E8E48-CFAA-4F57-AC35-63BEF4476159}.Debug|x86.ActiveCfg = Debug|x86
+ {D53E8E48-CFAA-4F57-AC35-63BEF4476159}.Debug|x86.Build.0 = Debug|x86
+ {D53E8E48-CFAA-4F57-AC35-63BEF4476159}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D53E8E48-CFAA-4F57-AC35-63BEF4476159}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D53E8E48-CFAA-4F57-AC35-63BEF4476159}.Release|x64.ActiveCfg = Release|x64
+ {D53E8E48-CFAA-4F57-AC35-63BEF4476159}.Release|x64.Build.0 = Release|x64
+ {D53E8E48-CFAA-4F57-AC35-63BEF4476159}.Release|x86.ActiveCfg = Release|x86
+ {D53E8E48-CFAA-4F57-AC35-63BEF4476159}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
Index: /branches/ItemTreeViews/3.3/Plugin.cs
===================================================================
--- /branches/ItemTreeViews/3.3/Plugin.cs (revision 14335)
+++ /branches/ItemTreeViews/3.3/Plugin.cs (revision 14335)
@@ -0,0 +1,36 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.ItemTreeViews.Views {
+ [Plugin("HeuristicLab.ItemTreeViews.Views", "3.3.14.14195")]
+ [PluginFile("HeuristicLab.ItemTreeViews.Views-3.3.dll", PluginFileType.Assembly)]
+ [PluginDependency("HeuristicLab.Collections", "3.3")]
+ [PluginDependency("HeuristicLab.Common", "3.3")]
+ [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
+ [PluginDependency("HeuristicLab.Core", "3.3")]
+ [PluginDependency("HeuristicLab.Core.Views", "3.3")]
+ [PluginDependency("HeuristicLab.MainForm", "3.3")]
+ [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
+ public class Plugin : PluginBase {
+ }
+}
Index: /branches/ItemTreeViews/3.3/PreBuildEvent.cmd
===================================================================
--- /branches/ItemTreeViews/3.3/PreBuildEvent.cmd (revision 14335)
+++ /branches/ItemTreeViews/3.3/PreBuildEvent.cmd (revision 14335)
@@ -0,0 +1,11 @@
+IF EXIST "%ProjectDir%\Properties\AssemblyInfo.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Properties\AssemblyInfo.cs.frame" "%ProjectDir%\Properties\AssemblyInfo.cs"
+IF %ERRORLEVEL% NEQ 0 GOTO Error_Handling
+IF EXIST "%ProjectDir%\Plugin.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Plugin.cs.frame" "%ProjectDir%\Plugin.cs"
+IF %ERRORLEVEL% NEQ 0 GOTO Error_Handling
+GOTO Done
+
+:Error_Handling
+ECHO There was an error while running subwcrev. Please verify that the *.cs.frame files have been correctly converted to *.cs files, otherwise HeuristicLab won't build.
+exit 0
+
+:Done
Index: /branches/ItemTreeViews/3.3/Properties/AssemblyInfo.cs
===================================================================
--- /branches/ItemTreeViews/3.3/Properties/AssemblyInfo.cs (revision 14335)
+++ /branches/ItemTreeViews/3.3/Properties/AssemblyInfo.cs (revision 14335)
@@ -0,0 +1,56 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.ItemTreeViews.Views")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2016 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("c8460c22-cba5-48ad-8283-1284313b2c17")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.14.14195")]
Index: /branches/ItemTreeViews/3.3/Views/ItemCollectionTreeView.cs
===================================================================
--- /branches/ItemTreeViews/3.3/Views/ItemCollectionTreeView.cs (revision 14335)
+++ /branches/ItemTreeViews/3.3/Views/ItemCollectionTreeView.cs (revision 14335)
@@ -0,0 +1,544 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Windows.Forms;
+using HeuristicLab.Collections;
+using HeuristicLab.Core;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.ItemTreeViews.Views {
+ [View("ItemCollection Tree View")]
+ [Content(typeof(ItemCollection<>), false)]
+ [Content(typeof(IItemCollection<>), false)]
+ [Content(typeof(ReadOnlyItemCollection<>), false)]
+ public partial class ItemCollectionTreeView : ItemView where T : class, IItem {
+
+ #region properties
+
+ protected Dictionary itemTreeViewItemMapping;
+ protected Dictionary treeViewChildrenMapping;
+ protected TypeSelectorDialog typeSelectorDialog;
+ protected bool validDragOperation;
+
+ public new IItemCollection Content
+ {
+ get { return (IItemCollection)base.Content; }
+ set
+ {
+ base.Content = value;
+ OnContentChanged();
+ }
+ }
+
+ public ObservableCollection ItemCollection { get { return Content as ObservableCollection; } }
+
+ public bool ShowDetails
+ {
+ get { return showDetailsCheckBox.Checked; }
+ set { showDetailsCheckBox.Checked = value; }
+ }
+
+ public TreeView ItemsTreeView { get { return itemsTreeView; } }
+
+ #endregion
+
+ public ItemCollectionTreeView() {
+ InitializeComponent();
+ itemTreeViewItemMapping = new Dictionary();
+ treeViewChildrenMapping = new Dictionary();
+ }
+
+ protected override void Dispose(bool disposing) {
+ if (disposing) {
+ if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
+ if (components != null) components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region eventregistration
+
+ protected override void DeregisterContentEvents() {
+ Content.ItemsAdded -= Content_ItemsAdded;
+ Content.ItemsRemoved -= Content_ItemsRemoved;
+ Content.CollectionReset -= Content_CollectionReset;
+ base.DeregisterContentEvents();
+ }
+
+ protected override void RegisterContentEvents() {
+ DeregisterContentEvents(); //prevent multiattaching
+ base.RegisterContentEvents();
+ Content.ItemsAdded += Content_ItemsAdded;
+ Content.ItemsRemoved += Content_ItemsRemoved;
+ Content.CollectionReset += Content_CollectionReset;
+ }
+
+ protected virtual void DeregisterItemEvents(T item) {
+ item.ItemImageChanged -= Item_ItemImageChanged;
+ item.ToStringChanged -= Item_ToStringChanged;
+ }
+
+ protected virtual void RegisterItemEvents(T item) {
+ DeregisterItemEvents(item); //prevent multiattaching
+ item.ItemImageChanged += Item_ItemImageChanged;
+ item.ToStringChanged += Item_ToStringChanged;
+ }
+
+ protected virtual void DeregisterViewEvents() {
+ ItemsTreeView.AfterSelect -= itemsTreeView_SelectedIndexChanged;
+ ItemsTreeView.DoubleClick -= itemsTreeView_DoubleClick;
+ ItemsTreeView.KeyDown -= itemsTreeView_KeyDown;
+ }
+
+ protected virtual void RegisterViewEvents() {
+ DeregisterViewEvents(); //prevent multiattaching
+ ItemsTreeView.AfterSelect += itemsTreeView_SelectedIndexChanged;
+ ItemsTreeView.DoubleClick += itemsTreeView_DoubleClick;
+ ItemsTreeView.KeyDown += itemsTreeView_KeyDown;
+ }
+
+ protected override void OnContentChanged() {
+ ItemsTreeView.BeginUpdate();
+ base.OnContentChanged();
+ ItemsTreeView.Nodes.Clear();
+ itemTreeViewItemMapping.Clear();
+ RebuildTreeImageList();
+ viewHost.Content = null;
+ if (Content == null) { ItemsTreeView.EndUpdate(); return; }
+ RegisterViewEvents();
+ Caption += " (" + Content.GetType().Name + ")";
+
+ foreach (T item in Content)
+ AddTreeNodeRecursive(item, null);
+ SortItemsTreeView();
+ ItemsTreeView.EndUpdate();
+ }
+
+ #endregion
+
+ protected override void SetEnabledStateOfControls() {
+ base.SetEnabledStateOfControls();
+ if (Content == null) {
+ addButton.Enabled = false;
+ sortAscendingButton.Enabled = false;
+ sortDescendingButton.Enabled = false;
+ removeButton.Enabled = false;
+ ItemsTreeView.Enabled = false;
+ detailsGroupBox.Enabled = false;
+ } else {
+ addButton.Enabled = !Content.IsReadOnly && !ReadOnly;
+ sortAscendingButton.Enabled = false;
+ sortDescendingButton.Enabled = false;
+ removeButton.Enabled = !Content.IsReadOnly && !ReadOnly && ItemsTreeView.Nodes.Count > 0;
+ ItemsTreeView.Enabled = true;
+ detailsGroupBox.Enabled = true;
+ }
+ }
+
+ protected virtual T CreateItem() {
+ if (typeSelectorDialog == null) {
+ typeSelectorDialog = new TypeSelectorDialog();
+ typeSelectorDialog.Caption = "Select Item";
+ typeSelectorDialog.TypeSelector.Caption = "Available Items";
+ typeSelectorDialog.TypeSelector.Configure(typeof(T), false, true);
+ }
+ if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
+ try {
+ return (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
+ }
+ catch (Exception ex) {
+ ErrorHandling.ShowErrorDialog(this, ex);
+ }
+ }
+ return null;
+ }
+
+ protected virtual TreeNode CreateTreeViewNode(T item) {
+ var treeViewNode = new TreeNode("noName");
+ treeViewNode.NodeFont = DefaultFont;
+ if (item == null) {
+ treeViewNode.Text = "null";
+ ItemsTreeView.ImageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Nothing);
+ treeViewNode.ImageIndex = ItemsTreeView.ImageList.Images.Count - 1;
+ treeViewNode.SelectedImageIndex = treeViewNode.ImageIndex;
+ } else {
+ treeViewNode.Text = item.ToString();
+ treeViewNode.ToolTipText = item.ItemName + ": " + item.ItemDescription;
+ ItemsTreeView.ImageList.Images.Add(item.ItemImage);
+ treeViewNode.ImageIndex = ItemsTreeView.ImageList.Images.Count - 1;
+ treeViewNode.SelectedImageIndex = treeViewNode.ImageIndex;
+ treeViewNode.Tag = item;
+ }
+ return treeViewNode;
+ }
+
+ #region recursive adding
+
+ protected virtual void AddTreeNode(T item) {
+ if (item != null && !itemTreeViewItemMapping.ContainsKey(item) && treeViewChildrenMapping.ContainsKey(item)) { //create TreeNode if not exists
+ RegisterItemEvents(item);
+ var node = CreateTreeViewNode(item);
+ itemTreeViewItemMapping[item] = node;
+ var p = GetParent(item);
+ (p == null ? ItemsTreeView.Nodes : itemTreeViewItemMapping[p].Nodes).Add(node);
+ }
+
+ }
+ protected void AddTreeNodeRecursive(T item, TreeNode parent) {
+ if (item == null) return;
+ Queue queue = new Queue();
+ queue.Enqueue(item);
+ if (!treeViewChildrenMapping.ContainsKey(item))
+ treeViewChildrenMapping.Add(item, parent != null ? parent.Tag as T : null); //Set explicitly to null in some cases. who cares??
+ while (queue.Count > 0 && (item = queue.Dequeue()) != null) {
+ AddTreeNode(item);
+ foreach (var child in ExpandTreeViewItem(item)) { //Expand queue
+ if (!treeViewChildrenMapping.ContainsKey(child)) {
+ treeViewChildrenMapping.Add(child, item);
+ }
+ queue.Enqueue(child);
+ }
+ }
+ }
+
+
+ protected void UpdateTreeNodeRecursive(T item, TreeNode parent) {
+ if (item == null) return;
+ Queue queue = new Queue();
+ queue.Enqueue(item);
+ //parent relation has to exist by now
+ //if (!treeViewChildrenMapping.ContainsKey(item))
+ //treeViewChildrenMapping.Add(item, parent != null ? parent.Tag as T : null); //Set explicitly to null in some cases. who cares??
+ while (queue.Count > 0 && (item = queue.Dequeue()) != null) {
+ AddTreeNode(item);
+ var newChildren = ExpandTreeViewItem(item);
+ var deadChildren =
+ itemTreeViewItemMapping[item].Nodes.Cast()
+ .Select(n => n.Tag as T)
+ .Where(t => !newChildren.Contains(t)).Select(t => itemTreeViewItemMapping[t])
+ .ToList();
+
+ foreach (var child in newChildren) { //Expand queue
+ if (!treeViewChildrenMapping.ContainsKey(child)) {
+ treeViewChildrenMapping.Add(child, item);
+ }
+ queue.Enqueue(child);
+ }
+
+ foreach (var child in deadChildren) {
+ RemoveTreeViewItem(child);
+ }
+ }
+ }
+
+
+
+ ///
+ /// This function defines which subnodes are created.
+ /// Override this to change which items are used in the creation of new nodes
+ ///
+ ///
+ ///
+ protected virtual List ExpandTreeViewItem(object parent) {
+ //unpack enumerables
+ var p = parent as IEnumerable;
+ if (p != null) return p.ToList();
+ //exclude LookupParameters from Value unpacking
+ if (parent is ILookupParameter) return new List();
+ //unpack "value"/"Value"/"ActualValue" relationship if possible
+ object prop = GetValue(parent);
+ //return nothing if failed
+ return (prop != null) ? ExpandTreeViewItem(prop) : new List();
+ }
+ #endregion
+
+ #region recursive removal
+ protected virtual void RemoveTreeViewItem(TreeNode treeViewItem) {
+ if (treeViewItem == null) return;
+ T item = treeViewItem.Tag as T;
+ if (item != null) {
+ treeViewChildrenMapping.Remove(item);
+ itemTreeViewItemMapping.Remove(item);
+ DeregisterItemEvents(item);
+ }
+ var children = GetChildren(item);
+ foreach (var node in children)
+ if (node != null && itemTreeViewItemMapping.ContainsKey(node))
+ RemoveTreeViewItem(itemTreeViewItemMapping[node]);
+ treeViewItem.Remove();
+
+ }
+ protected virtual void UpdateTreeViewItemImage(TreeNode treeViewNode) {
+ if (treeViewNode == null) throw new ArgumentNullException();
+ var item = treeViewNode.Tag as T;
+ var i = treeViewNode.ImageIndex;
+ ItemsTreeView.ImageList.Images[i] = item == null ? Common.Resources.VSImageLibrary.Nothing : item.ItemImage;
+ treeViewNode.ImageIndex = -1;
+ treeViewNode.SelectedImageIndex = treeViewNode.ImageIndex;
+ treeViewNode.ImageIndex = i;
+ }
+ protected virtual void UpdateTreeViewItemText(TreeNode treeViewNode) {
+ if (treeViewNode == null) throw new ArgumentNullException();
+ T item = treeViewNode.Tag as T;
+ treeViewNode.Text = item == null ? "null" : item.ToString();
+ treeViewNode.ToolTipText = item == null ? string.Empty : item.ItemName + ": " + item.ItemDescription;
+ }
+ protected virtual TreeNode GetTreeNodeForItem(T item) {
+ if (item == null)
+ return GetAllNodes(ItemsTreeView).First(x => x.Tag == null);
+ TreeNode viewItem;
+ itemTreeViewItemMapping.TryGetValue(item, out viewItem);
+ return viewItem;
+
+ }
+ #endregion
+
+ #region View Events
+ protected virtual void itemsTreeView_SelectedIndexChanged(object sender, EventArgs e) {
+ removeButton.Enabled = (Content != null) && !Content.IsReadOnly && !ReadOnly && ItemsTreeView.SelectedNode != null;
+ if (showDetailsCheckBox.Checked) {
+ var item = ItemsTreeView.SelectedNode != null ? ItemsTreeView.SelectedNode.Tag as T : null;
+ detailsGroupBox.Enabled = true;
+ viewHost.Content = item;
+ }
+ }
+ protected virtual void itemsTreeView_KeyDown(object sender, KeyEventArgs e) {
+ if (e.KeyCode == Keys.Delete) {
+ if ((ItemsTreeView.SelectedNode != null) && !Content.IsReadOnly && !ReadOnly) {
+ //no multiselction but recursive deletion
+ var selected = GetAllNodes(ItemsTreeView.SelectedNode);
+ if (ItemCollection != null) ItemCollection.RemoveRange(selected.Select(i => (T)i.Tag));
+ else {
+ ItemsTreeView.BeginUpdate();
+ foreach (TreeNode item in selected) { Content.Remove((T)item.Tag); }
+ ItemsTreeView.EndUpdate();
+ }
+ }
+ }
+ }
+ protected virtual void itemsTreeView_DoubleClick(object sender, EventArgs e) {
+ T item = ItemsTreeView.SelectedNode != null ? ItemsTreeView.SelectedNode.Tag as T : null;
+ if (item == null) return;
+ IContentView view = MainFormManager.MainForm.ShowContent(item);
+ if (view == null) return;
+ view.ReadOnly = ReadOnly;
+ view.Locked = Locked;
+ }
+ #endregion
+
+ #region Button Events
+ protected virtual void addButton_Click(object sender, EventArgs e) {
+ T item = CreateItem();
+ if (item != null)
+ Content.Add(item);
+ }
+ protected virtual void sortAscendingButton_Click(object sender, EventArgs e) {
+ SortItemsTreeView();
+ }
+ protected virtual void sortDescendingButton_Click(object sender, EventArgs e) {
+ //DO nothing for Treeview (no custom sort order)
+ }
+ protected virtual void removeButton_Click(object sender, EventArgs e) {
+ if (ItemsTreeView.SelectedNode == null) return;
+ var selected = GetAllNodes(ItemsTreeView.SelectedNode);
+ if (ItemCollection != null) {
+ ItemCollection.RemoveRange(selected.Select(i => (T)i.Tag));
+ } else {
+ foreach (TreeNode item in selected)
+ Content.Remove((T)item.Tag);
+ }
+ ItemsTreeView.SelectedNode = null;
+ }
+ #endregion
+
+ #region CheckBox Events
+ protected virtual void showDetailsCheckBox_CheckedChanged(object sender, EventArgs e) {
+ if (showDetailsCheckBox.Checked) {
+ splitContainer.Panel2Collapsed = false;
+ detailsGroupBox.Enabled = ItemsTreeView.SelectedNode != null;
+ viewHost.Content = ItemsTreeView.SelectedNode != null ? ItemsTreeView.SelectedNode.Tag as T : null;
+ } else {
+ splitContainer.Panel2Collapsed = true;
+ viewHost.Content = null;
+ }
+ }
+ #endregion
+
+ #region Content Events
+ protected virtual void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs e) {
+ if (InvokeRequired)
+ Invoke(new CollectionItemsChangedEventHandler(Content_ItemsAdded), sender, e);
+ else {
+ ItemsTreeView.BeginUpdate();
+ foreach (T item in e.Items) {
+ AddTreeNodeRecursive(item, null);
+ }
+ RebuildTreeImageList();
+ ItemsTreeView.EndUpdate();
+ }
+
+ }
+ protected virtual void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs e) {
+ if (InvokeRequired)
+ Invoke(new CollectionItemsChangedEventHandler(Content_ItemsRemoved), sender, e);
+ else {
+ ItemsTreeView.BeginUpdate();
+ foreach (T item in e.Items) {
+ //remove only the first matching ViewItem, because the IItem could be contained multiple times in the ItemCollection
+ var treeNode = GetTreeNodeForItem(item);
+ if (treeNode != null) RemoveTreeViewItem(treeNode);
+
+ }
+ RebuildTreeImageList();
+ ItemsTreeView.EndUpdate();
+ }
+ }
+ protected virtual void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs e) {
+ if (InvokeRequired)
+ Invoke(new CollectionItemsChangedEventHandler(Content_CollectionReset), sender, e);
+ else {
+ ItemsTreeView.BeginUpdate();
+ foreach (T item in e.OldItems) {
+ //remove only the first matching ViewItem, because the IItem could be contained multiple times in the ItemCollection
+ var treeNode = GetTreeNodeForItem(item);
+ if (treeNode != null) RemoveTreeViewItem(treeNode);
+ }
+ RebuildTreeImageList();
+ foreach (T item in e.Items)
+ AddTreeNodeRecursive(item, null);
+ ItemsTreeView.EndUpdate();
+ }
+ }
+ #endregion
+
+ #region Item Events
+ protected virtual void Item_ItemImageChanged(object sender, EventArgs e) {
+ if (InvokeRequired)
+ Invoke(new EventHandler(Item_ItemImageChanged), sender, e);
+ else {
+ var item = sender as T;
+ var node = GetTreeNodeForItem(item);
+ if (node != null) { UpdateTreeViewItemImage(node); }
+
+ }
+ }
+ protected virtual void Item_ToStringChanged(object sender, EventArgs e) {
+ if (InvokeRequired)
+ Invoke(new EventHandler(Item_ToStringChanged), sender, e);
+ else {
+ var item = sender as T;
+ var itemNode = GetTreeNodeForItem(item);
+ if (itemNode == null) return; //nothing to remove
+ var parent = itemNode.Parent;
+ //update Node
+ ItemsTreeView.BeginUpdate();
+ // if (itemNode.Nodes.Count > 0)
+ // RemoveTreeViewItem(itemNode);
+ // AddTreeNodeRecursive(item, parent);
+ UpdateTreeNodeRecursive(item, parent);
+ UpdateTreeViewItemText(itemNode);
+ ItemsTreeView.EndUpdate();
+ }
+ }
+ #endregion
+
+ #region Helpers
+ // no sortOrder in TreeView
+ protected virtual void SortItemsTreeView() {
+ ItemsTreeView.Sort();
+ ItemsTreeView.Sorted = true;
+ }
+ // recursive image list rebuilding
+ protected virtual void RebuildTreeImageList() {
+ if (ItemsTreeView.ImageList == null) ItemsTreeView.ImageList = new ImageList();
+ ItemsTreeView.ImageList.Images.Clear();
+ foreach (TreeNode treeNode in GetAllNodes(ItemsTreeView)) {
+ T item = treeNode.Tag as T;
+ try {
+ ItemsTreeView.ImageList.Images.Add(item == null ? Common.Resources.VSImageLibrary.Nothing : item.ItemImage);
+ treeNode.ImageIndex = ItemsTreeView.ImageList.Images.Count - 1;
+ treeNode.SelectedImageIndex = treeNode.ImageIndex;
+ }
+ catch (ArgumentException) {
+ treeNode.SelectedImageIndex = ItemsTreeView.ImageList.Images.Count + 10000;
+ }
+ }
+ }
+ protected List GetAllNodes(TreeView view) {
+ var n = new List();
+ foreach (TreeNode node in view.Nodes) {
+ AddAllNodes(n, node);
+ }
+ return n;
+ }
+ private List GetAllNodes(TreeNode node) {
+ var n = new List();
+ AddAllNodes(n, node);
+ return n;
+ }
+ private static void AddAllNodes(List list, TreeNode node) {
+ if (list.Contains(node)) return;
+ list.Add(node);
+ foreach (TreeNode n in node.Nodes) {
+ AddAllNodes(list, n);
+ }
+ }
+
+ protected T GetParent(T child) {
+ return treeViewChildrenMapping.ContainsKey(child) ? treeViewChildrenMapping[child] : null;
+ }
+ protected TreeNode GetParent(TreeNode child) {
+ return child.Parent;
+ }
+ private static IItem GetValue(object parent) {
+ var props = parent.GetType().GetProperties();
+ foreach (var prop in props) {
+ if (prop.Name.Equals("Value", StringComparison.InvariantCultureIgnoreCase) || prop.Name.Equals("ActualValue", StringComparison.InvariantCultureIgnoreCase)) {
+ if (typeof(IItem).IsAssignableFrom(prop.PropertyType)) {
+ try { return prop.GetValue(parent) as IItem; }
+ catch (TargetInvocationException) { } //if getting the value is not an option (LookUpParameters,...) try other properties
+
+ }
+ }
+ }
+ return null;
+ }
+
+ protected List GetChildren(T parent) {
+ return treeViewChildrenMapping.Where(x => x.Value == parent).Select(x => x.Key).ToList();
+ }
+ private int CountAllNodes(TreeNode n) {
+ var nodes = n != null ? n.Nodes : null ?? ItemsTreeView.Nodes;
+ var res = 1;
+ foreach (var node in nodes.Cast()) {
+ res += CountAllNodes(node);
+ }
+ return res;
+ }
+ #endregion
+ }
+}
Index: /branches/ItemTreeViews/3.3/Views/ItemCollectionTreeView.designer.cs
===================================================================
--- /branches/ItemTreeViews/3.3/Views/ItemCollectionTreeView.designer.cs (revision 14335)
+++ /branches/ItemTreeViews/3.3/Views/ItemCollectionTreeView.designer.cs (revision 14335)
@@ -0,0 +1,231 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System.Windows.Forms;
+
+namespace HeuristicLab.ItemTreeViews.Views {
+ partial class ItemCollectionTreeView {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ this.components = new System.ComponentModel.Container();
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ItemCollectionTreeView));
+ this.splitContainer = new System.Windows.Forms.SplitContainer();
+ this.itemsTreeView = new System.Windows.Forms.TreeView();
+ this.showDetailsCheckBox = new System.Windows.Forms.CheckBox();
+ this.sortDescendingButton = new System.Windows.Forms.Button();
+ this.sortAscendingButton = new System.Windows.Forms.Button();
+ this.removeButton = new System.Windows.Forms.Button();
+ this.addButton = new System.Windows.Forms.Button();
+ this.detailsGroupBox = new System.Windows.Forms.GroupBox();
+ this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+ this.imageList = new System.Windows.Forms.ImageList(this.components);
+ this.itemsGroupBox = new System.Windows.Forms.GroupBox();
+ this.toolTip = new System.Windows.Forms.ToolTip(this.components);
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
+ this.splitContainer.Panel1.SuspendLayout();
+ this.splitContainer.Panel2.SuspendLayout();
+ this.splitContainer.SuspendLayout();
+ this.detailsGroupBox.SuspendLayout();
+ this.itemsGroupBox.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // splitContainer
+ //
+ this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
+ this.splitContainer.Location = new System.Drawing.Point(3, 16);
+ this.splitContainer.Name = "splitContainer";
+ //
+ // splitContainer.Panel1
+ //
+ this.splitContainer.Panel1.Controls.Add(this.itemsTreeView);
+ this.splitContainer.Panel1.Controls.Add(this.showDetailsCheckBox);
+ this.splitContainer.Panel1.Controls.Add(this.sortDescendingButton);
+ this.splitContainer.Panel1.Controls.Add(this.sortAscendingButton);
+ this.splitContainer.Panel1.Controls.Add(this.removeButton);
+ this.splitContainer.Panel1.Controls.Add(this.addButton);
+ this.splitContainer.Panel1MinSize = 100;
+ //
+ // splitContainer.Panel2
+ //
+ this.splitContainer.Panel2.Controls.Add(this.detailsGroupBox);
+ this.splitContainer.Size = new System.Drawing.Size(526, 364);
+ this.splitContainer.SplitterDistance = 250;
+ this.splitContainer.TabIndex = 0;
+ //
+ // itemsTreeView
+ //
+ this.itemsTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.itemsTreeView.Location = new System.Drawing.Point(3, 27);
+ this.itemsTreeView.Name = "itemsTreeView";
+ this.itemsTreeView.Size = new System.Drawing.Size(241, 329);
+ this.itemsTreeView.TabIndex = 7;
+ //
+ // showDetailsCheckBox
+ //
+ this.showDetailsCheckBox.Appearance = System.Windows.Forms.Appearance.Button;
+ this.showDetailsCheckBox.Checked = true;
+ this.showDetailsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.showDetailsCheckBox.Image = ((System.Drawing.Image)(resources.GetObject("showDetailsCheckBox.Image")));
+ this.showDetailsCheckBox.Location = new System.Drawing.Point(123, 3);
+ this.showDetailsCheckBox.Name = "showDetailsCheckBox";
+ this.showDetailsCheckBox.Size = new System.Drawing.Size(24, 24);
+ this.showDetailsCheckBox.TabIndex = 4;
+ this.toolTip.SetToolTip(this.showDetailsCheckBox, "Show/Hide Details");
+ this.showDetailsCheckBox.UseVisualStyleBackColor = true;
+ this.showDetailsCheckBox.CheckedChanged += new System.EventHandler(this.showDetailsCheckBox_CheckedChanged);
+ //
+ // sortDescendingButton
+ //
+ this.sortDescendingButton.Enabled = false;
+ this.sortDescendingButton.Image = ((System.Drawing.Image)(resources.GetObject("sortDescendingButton.Image")));
+ this.sortDescendingButton.Location = new System.Drawing.Point(33, 3);
+ this.sortDescendingButton.Name = "sortDescendingButton";
+ this.sortDescendingButton.Size = new System.Drawing.Size(24, 24);
+ this.sortDescendingButton.TabIndex = 1;
+ this.toolTip.SetToolTip(this.sortDescendingButton, "Sort Descending");
+ this.sortDescendingButton.UseVisualStyleBackColor = true;
+ this.sortDescendingButton.Click += new System.EventHandler(this.sortDescendingButton_Click);
+ //
+ // sortAscendingButton
+ //
+ this.sortAscendingButton.Enabled = false;
+ this.sortAscendingButton.Image = ((System.Drawing.Image)(resources.GetObject("sortAscendingButton.Image")));
+ this.sortAscendingButton.Location = new System.Drawing.Point(63, 3);
+ this.sortAscendingButton.Name = "sortAscendingButton";
+ this.sortAscendingButton.Size = new System.Drawing.Size(24, 24);
+ this.sortAscendingButton.TabIndex = 2;
+ this.toolTip.SetToolTip(this.sortAscendingButton, "Sort Ascending");
+ this.sortAscendingButton.UseVisualStyleBackColor = true;
+ this.sortAscendingButton.Click += new System.EventHandler(this.sortAscendingButton_Click);
+ //
+ // removeButton
+ //
+ this.removeButton.Enabled = false;
+ this.removeButton.Image = ((System.Drawing.Image)(resources.GetObject("removeButton.Image")));
+ this.removeButton.Location = new System.Drawing.Point(93, 3);
+ this.removeButton.Name = "removeButton";
+ this.removeButton.Size = new System.Drawing.Size(24, 24);
+ this.removeButton.TabIndex = 3;
+ this.toolTip.SetToolTip(this.removeButton, "Remove");
+ this.removeButton.UseVisualStyleBackColor = true;
+ this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
+ //
+ // addButton
+ //
+ this.addButton.Image = ((System.Drawing.Image)(resources.GetObject("addButton.Image")));
+ this.addButton.Location = new System.Drawing.Point(3, 3);
+ this.addButton.Name = "addButton";
+ this.addButton.Size = new System.Drawing.Size(24, 24);
+ this.addButton.TabIndex = 0;
+ this.toolTip.SetToolTip(this.addButton, "Add");
+ this.addButton.UseVisualStyleBackColor = true;
+ this.addButton.Click += new System.EventHandler(this.addButton_Click);
+ //
+ // detailsGroupBox
+ //
+ this.detailsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.detailsGroupBox.Controls.Add(this.viewHost);
+ this.detailsGroupBox.Location = new System.Drawing.Point(3, 27);
+ this.detailsGroupBox.Name = "detailsGroupBox";
+ this.detailsGroupBox.Size = new System.Drawing.Size(266, 335);
+ this.detailsGroupBox.TabIndex = 0;
+ this.detailsGroupBox.TabStop = false;
+ this.detailsGroupBox.Text = "Details";
+ //
+ // viewHost
+ //
+ this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.viewHost.Caption = "View";
+ this.viewHost.Content = null;
+ this.viewHost.Enabled = false;
+ this.viewHost.Location = new System.Drawing.Point(6, 19);
+ this.viewHost.Name = "viewHost";
+ this.viewHost.ReadOnly = false;
+ this.viewHost.Size = new System.Drawing.Size(254, 310);
+ this.viewHost.TabIndex = 0;
+ this.viewHost.ViewsLabelVisible = true;
+ this.viewHost.ViewType = null;
+ //
+ // imageList
+ //
+ this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
+ this.imageList.ImageSize = new System.Drawing.Size(16, 16);
+ this.imageList.TransparentColor = System.Drawing.Color.Transparent;
+ //
+ // itemsGroupBox
+ //
+ this.itemsGroupBox.Controls.Add(this.splitContainer);
+ this.itemsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.itemsGroupBox.Location = new System.Drawing.Point(0, 0);
+ this.itemsGroupBox.Name = "itemsGroupBox";
+ this.itemsGroupBox.Size = new System.Drawing.Size(532, 383);
+ this.itemsGroupBox.TabIndex = 0;
+ this.itemsGroupBox.TabStop = false;
+ this.itemsGroupBox.Text = "Items";
+ //
+ // ItemCollectionTreeView
+ //
+ this.Controls.Add(this.itemsGroupBox);
+ this.Name = "ItemCollectionTreeView";
+ this.Size = new System.Drawing.Size(532, 383);
+ this.splitContainer.Panel1.ResumeLayout(false);
+ this.splitContainer.Panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
+ this.splitContainer.ResumeLayout(false);
+ this.detailsGroupBox.ResumeLayout(false);
+ this.itemsGroupBox.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ protected System.Windows.Forms.SplitContainer splitContainer;
+ protected GroupBox itemsGroupBox;
+ protected GroupBox detailsGroupBox;
+ protected Button addButton;
+ protected Button removeButton;
+ protected ToolTip toolTip;
+ protected ImageList imageList;
+ protected HeuristicLab.MainForm.WindowsForms.ViewHost viewHost;
+ protected Button sortAscendingButton;
+ protected Button sortDescendingButton;
+ protected CheckBox showDetailsCheckBox;
+ private TreeView itemsTreeView;
+ }
+}
Index: /branches/ItemTreeViews/3.3/Views/ItemCollectionTreeView.resx
===================================================================
--- /branches/ItemTreeViews/3.3/Views/ItemCollectionTreeView.resx (revision 14335)
+++ /branches/ItemTreeViews/3.3/Views/ItemCollectionTreeView.resx (revision 14335)
@@ -0,0 +1,329 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACH
+ DwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKOWlDQ1BQaG90b3Nob3AgSUNDIHByb2Zp
+ bGUAAEjHnZZ3VFTXFofPvXd6oc0wAlKG3rvAANJ7k15FYZgZYCgDDjM0sSGiAhFFRJoiSFDEgNFQJFZE
+ sRAUVLAHJAgoMRhFVCxvRtaLrqy89/Ly++Osb+2z97n77L3PWhcAkqcvl5cGSwGQyhPwgzyc6RGRUXTs
+ AI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C5R69TXy/MF72Rf3P4LeNt37vwd5MLWe+x7ys/
+ 6H7o/ujz8cGn1E+f/gUDmPP8usTo0wAAAAlwSFlzAAALEwAACxMBAJqcGAAAAY9JREFUOE+lj90rQ2Ec
+ x1cuZHmnSIuWVsia4e9AEso7zXvSspjGptHKJprkNVxw44IbF9wIKdGRrGQ2G8elUrtydc75+h1lmfNc
+ WC4+9fR5vt/f73lUAP4FU8YDUxLJoe1ELrCZxN1vqLm7lZRTRuYLpiQSHjbUEF6nIPAOXC2mC4zMF0wp
+ c7ucEh1w5skmxc4xpcylNyMi8JMQXsZx5MohhbSf999ED77V5NObpVTuypvBXcxncifubEF4GYUYNuPA
+ ocGeLR+7Vi22LIVYM+t4xYDrxXTaaKeNE4QVQniEGIIY6oP41AUx2ArpsZGog3ewWDngfC6LNo5DfLZQ
+ cZiKA1Q0UbEdUqCJivWQ/LWQHqow261/Uww4duXi0JmHfYcmuGcr4HbGtBADzVRswNJQERb6S+Du1cNl
+ MsDZYYwoBvxm3az7kJ8r+Wvg6S0lFXOv/T7/lDHQP98lfzUNqMJMl4EUO8eUMu4ePS//V8beWk6KnWNK
+ menOMp+jzQhbSwWsTZWk2DmmjAem/DtQfQI3TuP3lWFhogAAAABJRU5ErkJggg==
+
+
+
+ 17, 17
+
+
Index: /branches/ItemTreeViews/3.3/Views/ItemCollectionTreeViewDummy.cs
===================================================================
--- /branches/ItemTreeViews/3.3/Views/ItemCollectionTreeViewDummy.cs (revision 14335)
+++ /branches/ItemTreeViews/3.3/Views/ItemCollectionTreeViewDummy.cs (revision 14335)
@@ -0,0 +1,31 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using HeuristicLab.Core.Views;
+
+namespace HeuristicLab.ItemTreeViews.Views {
+
+ ///
+ /// the existance of this class allows the designer to display the generic ItemCollectionTreeView
+ ///
+ public class ItemCollectionTreeView : ItemView {
+ }
+}
Index: /branches/ItemTreeViews/3.3/Views/NamedItemCollectionTreeView.Designer.cs
===================================================================
--- /branches/ItemTreeViews/3.3/Views/NamedItemCollectionTreeView.Designer.cs (revision 14335)
+++ /branches/ItemTreeViews/3.3/Views/NamedItemCollectionTreeView.Designer.cs (revision 14335)
@@ -0,0 +1,62 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+
+namespace HeuristicLab.ItemTreeViews.Views {
+ partial class NamedItemCollectionTreeView {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing) {
+ if (disposing) {
+ if (components != null) components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ this.SuspendLayout();
+ //
+ // NamedItemCollectionTreeView
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.Name = "NamedItemCollectionView";
+ this.Size = new System.Drawing.Size(532, 383);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ }
+}
Index: /branches/ItemTreeViews/3.3/Views/NamedItemCollectionTreeView.cs
===================================================================
--- /branches/ItemTreeViews/3.3/Views/NamedItemCollectionTreeView.cs (revision 14335)
+++ /branches/ItemTreeViews/3.3/Views/NamedItemCollectionTreeView.cs (revision 14335)
@@ -0,0 +1,115 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System.Windows.Forms;
+using HeuristicLab.Collections;
+using HeuristicLab.Core;
+using HeuristicLab.MainForm;
+
+namespace HeuristicLab.ItemTreeViews.Views {
+ [View("NamedItemCollection Tree View")]
+ [Content(typeof(NamedItemCollection<>), false)]
+ public partial class NamedItemCollectionTreeView : ItemCollectionTreeView where T : class, INamedItem {
+ public new IKeyedItemCollection Content
+ {
+ get { return (IKeyedItemCollection)base.Content; }
+ set { base.Content = value; }
+ }
+
+ public NamedItemCollectionTreeView() {
+ InitializeComponent();
+ }
+
+ protected override void DeregisterContentEvents() {
+ Content.ItemsReplaced -= Content_ItemsReplaced;
+ base.DeregisterContentEvents();
+ }
+ protected override void RegisterContentEvents() {
+ base.RegisterContentEvents();
+ Content.ItemsReplaced += Content_ItemsReplaced;
+ }
+
+ protected override void OnContentChanged() {
+ string selectedName = null;
+ if ((ItemsTreeView.SelectedNode != null ? ItemsTreeView.SelectedNode.Tag as T : null) is T)
+ selectedName = ((T)ItemsTreeView.SelectedNode.Tag).Name;
+
+ base.OnContentChanged();
+
+ if (selectedName == null) return;
+ foreach (TreeNode item in ItemsTreeView.Nodes)
+ if ((item.Tag != null) && ((T)item.Tag).Name.Equals(selectedName))
+ ItemsTreeView.SelectedNode = item;
+ }
+
+ protected override T CreateItem() {
+ T item = base.CreateItem();
+ if (item != null) {
+ item.Name = GetUniqueName(item.Name);
+ }
+ return item;
+ }
+
+ protected override TreeNode CreateTreeViewNode(T item) {
+ var listViewItem = base.CreateTreeViewNode(item);
+ if (!string.IsNullOrEmpty(item != null ? item.Description : null)) {
+ listViewItem.ToolTipText = item.ItemName + ": " + item.Description;
+ }
+ return listViewItem;
+ }
+ protected override void UpdateTreeViewItemText(TreeNode treeViewNode) {
+ base.UpdateTreeViewItemText(treeViewNode);
+ T item = treeViewNode.Tag as T;
+ if (!string.IsNullOrEmpty(item != null ? item.Description : null)) {
+ treeViewNode.ToolTipText = item.ItemName + ": " + item.Description;
+ }
+ }
+
+ #region Content Events
+ protected virtual void Content_ItemsReplaced(object sender, CollectionItemsChangedEventArgs e) {
+ if (InvokeRequired)
+ Invoke(new CollectionItemsChangedEventHandler(Content_ItemsReplaced), sender, e);
+ else {
+ ItemsTreeView.BeginUpdate();
+ foreach (T item in e.Items)
+ UpdateTreeViewItemText(GetTreeNodeForItem(item));
+ ItemsTreeView.EndUpdate();
+ }
+ }
+ #endregion
+
+ #region Helpers
+ protected virtual string GetUniqueName(string originalName) {
+ if (!Content.ContainsKey(originalName))
+ return originalName;
+
+ string name;
+ int index = 0;
+ do {
+ index++;
+ name = originalName + index;
+ } while (Content.ContainsKey(name));
+ return name;
+
+ }
+ #endregion
+ }
+}
Index: /branches/ItemTreeViews/3.3/Views/ParameterCollectionTreeView.cs
===================================================================
--- /branches/ItemTreeViews/3.3/Views/ParameterCollectionTreeView.cs (revision 14335)
+++ /branches/ItemTreeViews/3.3/Views/ParameterCollectionTreeView.cs (revision 14335)
@@ -0,0 +1,235 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Collections;
+using HeuristicLab.Core;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+
+namespace HeuristicLab.ItemTreeViews.Views {
+ [View("ParameterCollection Tree View")]
+ [Content(typeof(ParameterCollection), false)]
+ [Content(typeof(IKeyedItemCollection), false)]
+ public partial class ParameterCollectionTreeView : NamedItemCollectionTreeView {
+ protected CreateParameterDialog createParameterDialog;
+
+ protected bool allowEditingOfHiddenParameters;
+ public virtual bool AllowEditingOfHiddenParameters
+ {
+ get { return allowEditingOfHiddenParameters; }
+ set
+ {
+ if (value != allowEditingOfHiddenParameters) {
+ allowEditingOfHiddenParameters = value;
+ SetEnabledStateOfControls();
+ }
+ }
+ }
+
+ public ParameterCollectionTreeView() {
+ InitializeComponent();
+ itemsGroupBox.Text = "Parameters";
+ allowEditingOfHiddenParameters = true;
+ }
+
+ protected override void Dispose(bool disposing) {
+ if (disposing) {
+ if (createParameterDialog != null)
+ createParameterDialog.Dispose();
+ if (components != null)
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+ protected override void DeregisterItemEvents(IParameter item) {
+ item.HiddenChanged -= Item_HiddenChanged;
+ base.DeregisterItemEvents(item);
+ }
+ protected override void RegisterItemEvents(IParameter item) {
+ base.RegisterItemEvents(item);
+ item.HiddenChanged += Item_HiddenChanged;
+ }
+ protected override void OnContentChanged() {
+ base.OnContentChanged();
+ if ((Content == null) || !Content.Any(x => x.Hidden))
+ showHiddenParametersCheckBox.Checked = false;
+ }
+ protected override void SetEnabledStateOfControls() {
+ base.SetEnabledStateOfControls();
+ showHiddenParametersCheckBox.Enabled = (Content != null) && Content.Any(x => x.Hidden);
+ viewHost.ReadOnly = ReadOnly;
+ }
+ protected override IParameter CreateItem() {
+ if (createParameterDialog == null) createParameterDialog = new CreateParameterDialog();
+
+ if (createParameterDialog.ShowDialog(this) == DialogResult.OK) {
+ IParameter param = createParameterDialog.Parameter;
+ if ((param != null) && Content.ContainsKey(param.Name))
+ param = (IParameter)Activator.CreateInstance(param.GetType(), GetUniqueName(param.Name), param.Description);
+ return param;
+ }
+ return null;
+ }
+ protected override TreeNode CreateTreeViewNode(IParameter item) {
+ var viewItem = base.CreateTreeViewNode(item);
+ if ((item != null) && item.Hidden) {
+ viewItem.NodeFont = new Font(viewItem.NodeFont, FontStyle.Italic);
+ viewItem.ForeColor = Color.LightGray;
+ }
+ return viewItem;
+ }
+
+ protected override void AddTreeNode(IParameter p) {
+ base.AddTreeNode(p);
+ if (p != null) UpdateParameterVisibility(p);
+ }
+ protected virtual void UpdateParameterVisibility(IParameter parameter) {
+ var treeNode = GetTreeNodeForItem(parameter);
+ if (parameter.Hidden) {
+ treeNode.NodeFont = new Font(treeNode.NodeFont, FontStyle.Italic);
+ treeNode.ForeColor = Color.LightGray;
+ } else {
+ treeNode.NodeFont = new Font(treeNode.NodeFont, FontStyle.Regular);
+ treeNode.ForeColor = ItemsTreeView.ForeColor;
+ }
+
+ if (!showHiddenParametersCheckBox.Checked && parameter.Hidden) //remove hidden nodes
+ treeNode.Remove();
+ else if (treeNode.Parent == null && !ItemsTreeView.Nodes.Contains(treeNode)) {// nonadded Nodes
+ var p = GetParent(parameter);
+ (p == null ? ItemsTreeView.Nodes : GetTreeNodeForItem(p).Nodes).Add(treeNode);
+ }
+
+ }
+ protected override List ExpandTreeViewItem(object parent) {
+ var p = parent as IParameterizedItem;
+ if (p == null || p.Parameters == null) return base.ExpandTreeViewItem(parent);
+ return p.Parameters.ToList();
+ }
+
+
+ #region Control Events
+ protected virtual void showHiddenParametersCheckBox_CheckedChanged(object sender, EventArgs e) {
+ if (Content == null) return;
+ var items = itemTreeViewItemMapping.Keys.Where(x => x.Hidden).OrderBy(x => x.ToString()).ToArray();
+ ItemsTreeView.BeginUpdate();
+ Array.ForEach(items, UpdateParameterVisibility);
+ ItemsTreeView.EndUpdate();
+ }
+ protected override void itemsTreeView_SelectedIndexChanged(object sender, EventArgs e) {
+ base.itemsTreeView_SelectedIndexChanged(sender, e);
+ SetEnabledStateOfControls();
+ }
+ protected override void itemsTreeView_DoubleClick(object sender, EventArgs e) {
+ var item = ItemsTreeView.SelectedNode != null ? ItemsTreeView.SelectedNode.Tag as IParameter : null;
+ if (item == null) return;
+ var view = MainFormManager.MainForm.ShowContent(item);
+ if (view == null) return;
+ view.ReadOnly = ReadOnly || (item.Hidden && !AllowEditingOfHiddenParameters);
+ view.Locked = Locked;
+
+ }
+ protected virtual void itemsTreeViewContextMenuStrip_Opening(object sender, System.ComponentModel.CancelEventArgs e) {
+ showHideParametersToolStripMenuItem.Text = "Show/Hide Parameters";
+ showHideParametersToolStripMenuItem.Enabled = false;
+ if (ItemsTreeView.SelectedNode == null) {
+ e.Cancel = true;
+ } else if (!ReadOnly && !Locked && AllowEditingOfHiddenParameters) {
+ List parameters = new List();
+ IParameter parameter = ItemsTreeView.SelectedNode.Tag as IParameter;
+ if (parameter != null) parameters.Add(parameter);
+
+ showHideParametersToolStripMenuItem.Enabled = parameters.Count > 0;
+ if (parameters.Count == 1) showHideParametersToolStripMenuItem.Text = parameters[0].Hidden ? "Show Parameter" : "Hide Parameter";
+ else if ((parameters.Count > 1) && parameters.All(x => x.Hidden == parameters[0].Hidden)) showHideParametersToolStripMenuItem.Text = parameters[0].Hidden ? "Show Parameters" : "Hide Parameters";
+ showHideParametersToolStripMenuItem.Tag = parameters;
+ }
+ }
+ protected virtual void showHideParametersToolStripMenuItem_Click(object sender, EventArgs e) {
+ foreach (IParameter parameter in (IEnumerable)showHideParametersToolStripMenuItem.Tag)
+ parameter.Hidden = !parameter.Hidden;
+ }
+ protected override void showDetailsCheckBox_CheckedChanged(object sender, EventArgs e) {
+ base.showDetailsCheckBox_CheckedChanged(sender, e);
+ SetEnabledStateOfControls();
+ }
+ #endregion
+
+ #region Content Events
+ protected override void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs e) {
+ if (InvokeRequired)
+ Invoke(new CollectionItemsChangedEventHandler(Content_ItemsAdded), sender, e);
+ else {
+ base.Content_ItemsAdded(sender, e);
+ showHiddenParametersCheckBox.Enabled = Content.Any(x => x.Hidden);
+ }
+ }
+ protected override void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs e) {
+ if (InvokeRequired)
+ Invoke(new CollectionItemsChangedEventHandler(Content_ItemsRemoved), sender, e);
+ else {
+ base.Content_ItemsRemoved(sender, e);
+ }
+ }
+ protected override void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs e) {
+ if (InvokeRequired) Invoke(new CollectionItemsChangedEventHandler(Content_CollectionReset), sender, e);
+ else base.Content_CollectionReset(sender, e);
+ }
+ #endregion
+
+ #region Item Events
+ protected virtual void Item_HiddenChanged(object sender, EventArgs e) {
+ if (InvokeRequired)
+ Invoke(new EventHandler(Item_HiddenChanged), sender, e);
+ else {
+ ItemsTreeView.BeginUpdate();
+ UpdateParameterVisibility((IParameter)sender);
+ ItemsTreeView.EndUpdate();
+ }
+ }
+ #endregion
+
+ #region Helpers
+ protected override void RebuildTreeImageList() {
+ base.RebuildTreeImageList();
+ if (!showHiddenParametersCheckBox.Checked) {
+ // update image of hidden list view items
+ foreach (IParameter parameter in itemTreeViewItemMapping.Keys.Where(x => x.Hidden)) {
+ var treeNode = GetTreeNodeForItem(parameter);
+ try {
+ ItemsTreeView.ImageList.Images.Add(parameter == null ? Common.Resources.VSImageLibrary.Nothing : parameter.ItemImage);
+ treeNode.ImageIndex = ItemsTreeView.ImageList.Images.Count - 1;
+ treeNode.SelectedImageIndex = treeNode.ImageIndex;
+ }
+ catch (ArgumentException) {
+ treeNode.SelectedImageIndex = ItemsTreeView.ImageList.Images.Count + 10000;
+ }
+ }
+ }
+ }
+ #endregion
+ }
+}
Index: /branches/ItemTreeViews/3.3/Views/ParameterCollectionTreeView.designer.cs
===================================================================
--- /branches/ItemTreeViews/3.3/Views/ParameterCollectionTreeView.designer.cs (revision 14335)
+++ /branches/ItemTreeViews/3.3/Views/ParameterCollectionTreeView.designer.cs (revision 14335)
@@ -0,0 +1,106 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System.Windows.Forms;
+namespace HeuristicLab.ItemTreeViews.Views {
+ partial class ParameterCollectionTreeView {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ components = new System.ComponentModel.Container();
+ this.showHiddenParametersCheckBox = new System.Windows.Forms.CheckBox();
+ this.itemsListViewContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.showHideParametersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
+ this.splitContainer.Panel1.SuspendLayout();
+ this.splitContainer.Panel2.SuspendLayout();
+ this.splitContainer.SuspendLayout();
+ this.detailsGroupBox.SuspendLayout();
+ this.itemsGroupBox.SuspendLayout();
+ this.itemsListViewContextMenuStrip.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // splitContainer.Panel1
+ //
+ this.splitContainer.Panel1.Controls.Add(this.showHiddenParametersCheckBox);
+ //
+ // itemsListView
+ //
+ //
+ // showHiddenParametersCheckBox
+ //
+ this.showHiddenParametersCheckBox.Appearance = System.Windows.Forms.Appearance.Button;
+ this.showHiddenParametersCheckBox.Checked = false;
+ this.showHiddenParametersCheckBox.CheckState = System.Windows.Forms.CheckState.Unchecked;
+ this.showHiddenParametersCheckBox.Image = HeuristicLab.Common.Resources.VSImageLibrary.HiddenField;
+ this.showHiddenParametersCheckBox.Location = new System.Drawing.Point(153, 3);
+ this.showHiddenParametersCheckBox.Name = "showHiddenParametersCheckBox";
+ this.showHiddenParametersCheckBox.Size = new System.Drawing.Size(24, 24);
+ this.showHiddenParametersCheckBox.TabIndex = 5;
+ this.toolTip.SetToolTip(this.showHiddenParametersCheckBox, "Show Hidden Parameters");
+ this.showHiddenParametersCheckBox.UseVisualStyleBackColor = true;
+ this.showHiddenParametersCheckBox.CheckedChanged += new System.EventHandler(showHiddenParametersCheckBox_CheckedChanged);
+ //
+ // itemsListViewContextMenuStrip
+ //
+ this.itemsListViewContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.showHideParametersToolStripMenuItem});
+ this.itemsListViewContextMenuStrip.Name = "itemsListViewContextMenuStrip";
+ this.itemsListViewContextMenuStrip.Size = new System.Drawing.Size(161, 26);
+ this.itemsListViewContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(itemsTreeViewContextMenuStrip_Opening);
+ //
+ // showHideParametersToolStripMenuItem
+ //
+ this.showHideParametersToolStripMenuItem.Name = "showHideParametersToolStripMenuItem";
+ this.showHideParametersToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
+ this.showHideParametersToolStripMenuItem.Text = "Show/Hide Parameters";
+ this.showHideParametersToolStripMenuItem.Click += new System.EventHandler(showHideParametersToolStripMenuItem_Click);
+ //
+ // ParameterCollectionTreeView
+ //
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+ this.Name = "ParameterCollectionView";
+ this.splitContainer.Panel1.ResumeLayout(false);
+ this.splitContainer.Panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
+ this.splitContainer.ResumeLayout(false);
+ this.detailsGroupBox.ResumeLayout(false);
+ this.itemsGroupBox.ResumeLayout(false);
+ this.itemsListViewContextMenuStrip.ResumeLayout(false);
+ this.ResumeLayout(false);
+ }
+
+ #endregion
+
+ protected CheckBox showHiddenParametersCheckBox;
+ protected ContextMenuStrip itemsListViewContextMenuStrip;
+ protected ToolStripMenuItem showHideParametersToolStripMenuItem;
+ }
+}
Index: /branches/ItemTreeViews/3.3/Views/ParameterizedNamedItemTreeView.cs
===================================================================
--- /branches/ItemTreeViews/3.3/Views/ParameterizedNamedItemTreeView.cs (revision 14335)
+++ /branches/ItemTreeViews/3.3/Views/ParameterizedNamedItemTreeView.cs (revision 14335)
@@ -0,0 +1,54 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using HeuristicLab.Core;
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+
+namespace HeuristicLab.ItemTreeViews.Views {
+ ///
+ /// The base class for visual representations of items.
+ ///
+ [View("ParameterizedNamedItem TreeView")]
+ [Content(typeof(ParameterizedNamedItem), false)]
+ [Content(typeof(IParameterizedNamedItem), false)]
+ public partial class ParameterizedNamedItemTreeView : NamedItemView {
+ public new IParameterizedNamedItem Content
+ {
+ get { return (IParameterizedNamedItem)base.Content; }
+ set { base.Content = value; }
+ }
+
+ public ParameterizedNamedItemTreeView() {
+ InitializeComponent();
+ }
+
+ protected override void OnContentChanged() {
+ base.OnContentChanged();
+ parameterCollectionTreeView.Content = Content == null ? null : Content.Parameters;
+ }
+
+ protected override void SetEnabledStateOfControls() {
+ base.SetEnabledStateOfControls();
+ parameterCollectionTreeView.Enabled = Content != null;
+ }
+ }
+}
Index: /branches/ItemTreeViews/3.3/Views/ParameterizedNamedItemTreeView.designer.cs
===================================================================
--- /branches/ItemTreeViews/3.3/Views/ParameterizedNamedItemTreeView.designer.cs (revision 14335)
+++ /branches/ItemTreeViews/3.3/Views/ParameterizedNamedItemTreeView.designer.cs (revision 14335)
@@ -0,0 +1,97 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+namespace HeuristicLab.ItemTreeViews.Views {
+ partial class ParameterizedNamedItemTreeView {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing) {
+ if (disposing) {
+ if (components != null) components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ this.parameterCollectionTreeView = new ItemTreeViews.Views.ParameterCollectionTreeView();
+ ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+ this.SuspendLayout();
+ //
+ // nameTextBox
+ //
+ this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+ this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+ this.nameTextBox.Location = new System.Drawing.Point(59, 0);
+ this.nameTextBox.Size = new System.Drawing.Size(380, 20);
+ //
+ // infoLabel
+ //
+ this.infoLabel.Location = new System.Drawing.Point(445, 3);
+ //
+ // parameterCollectionTreeView
+ //
+ this.parameterCollectionTreeView.AllowEditingOfHiddenParameters = true;
+ this.parameterCollectionTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.parameterCollectionTreeView.Caption = "ParameterCollection Tree View";
+ this.parameterCollectionTreeView.Content = null;
+ this.parameterCollectionTreeView.Location = new System.Drawing.Point(7, 26);
+ this.parameterCollectionTreeView.Name = "parameterCollectionTreeView";
+ this.parameterCollectionTreeView.ReadOnly = false;
+ this.parameterCollectionTreeView.ShowDetails = true;
+ this.parameterCollectionTreeView.Size = new System.Drawing.Size(454, 389);
+ this.parameterCollectionTreeView.TabIndex = 3;
+ //
+ // ParameterizedNamedItemTreeView
+ //
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+ this.Controls.Add(this.parameterCollectionTreeView);
+ this.Name = "ParameterizedNamedItemTreeView";
+ this.Size = new System.Drawing.Size(464, 418);
+ this.Controls.SetChildIndex(this.infoLabel, 0);
+ this.Controls.SetChildIndex(this.nameTextBox, 0);
+ this.Controls.SetChildIndex(this.nameLabel, 0);
+ this.Controls.SetChildIndex(this.parameterCollectionTreeView, 0);
+ ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private ItemTreeViews.Views.ParameterCollectionTreeView parameterCollectionTreeView;
+ }
+}
Index: /branches/ItemTreeViews/3.3/Views/ParameterizedNamedItemTreeView.resx
===================================================================
--- /branches/ItemTreeViews/3.3/Views/ParameterizedNamedItemTreeView.resx (revision 14335)
+++ /branches/ItemTreeViews/3.3/Views/ParameterizedNamedItemTreeView.resx (revision 14335)
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
+ 140, 17
+
+