Changeset 11528 for branches/OptimizationNetworks
- Timestamp:
- 11/10/14 01:42:42 (10 years ago)
- Location:
- branches/OptimizationNetworks
- Files:
-
- 18 edited
- 8 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/GenericPortView.cs
r11526 r11528 30 30 [Content(typeof(IGenericPort), false)] 31 31 public partial class GenericPortView : PortView { 32 protected EntitySelectorDialog entitySelectorDialog;32 protected NetworkItemSelectorDialog networkItemSelectorDialog; 33 33 34 34 public new IGenericPort Content { … … 45 45 protected override void Dispose(bool disposing) { 46 46 if (disposing) { 47 if ( entitySelectorDialog != null) entitySelectorDialog.Dispose();47 if (networkItemSelectorDialog != null) networkItemSelectorDialog.Dispose(); 48 48 if (components != null) components.Dispose(); 49 49 } … … 114 114 115 115 protected virtual void setConnectedPortButton_Click(object sender, EventArgs e) { 116 if ( entitySelectorDialog == null) {117 entitySelectorDialog = new EntitySelectorDialog();118 entitySelectorDialog.Caption = "Select Connected Port";119 entitySelectorDialog.EntitySelector.Caption = "Available Ports";116 if (networkItemSelectorDialog == null) { 117 networkItemSelectorDialog = new NetworkItemSelectorDialog(); 118 networkItemSelectorDialog.Caption = "Select Connected Port"; 119 networkItemSelectorDialog.NetworkItemSelector.Caption = "Available Ports"; 120 120 } 121 121 122 122 try { 123 I Entityroot = Content;123 INetworkItem root = Content; 124 124 while (root.Parent != null) 125 125 root = root.Parent; 126 entitySelectorDialog.EntitySelector.Configure(126 networkItemSelectorDialog.NetworkItemSelector.Configure( 127 127 root, 128 128 Content.ConnectedPort, … … 130 130 ); 131 131 132 if ( entitySelectorDialog.ShowDialog(this) == DialogResult.OK) {133 Content.ConnectedPort = entitySelectorDialog.EntitySelector.SelectedEntityas IConnectedPort;132 if (networkItemSelectorDialog.ShowDialog(this) == DialogResult.OK) { 133 Content.ConnectedPort = networkItemSelectorDialog.NetworkItemSelector.SelectedNetworkItem as IConnectedPort; 134 134 } 135 135 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/NetworkItemSelector.Designer.cs
r11527 r11528 21 21 22 22 namespace HeuristicLab.Core.Networks.Views { 23 partial class EntitySelector {23 partial class NetworkItemSelector { 24 24 /// <summary> 25 25 /// Required designer variable. … … 46 46 private void InitializeComponent() { 47 47 this.components = new System.ComponentModel.Container(); 48 this. entitiesTreeView = new System.Windows.Forms.TreeView();49 this. entitiesGroupBox = new System.Windows.Forms.GroupBox();48 this.networkItemsTreeView = new System.Windows.Forms.TreeView(); 49 this.networkItemsGroupBox = new System.Windows.Forms.GroupBox(); 50 50 this.imageList = new System.Windows.Forms.ImageList(this.components); 51 this. entitiesGroupBox.SuspendLayout();51 this.networkItemsGroupBox.SuspendLayout(); 52 52 this.SuspendLayout(); 53 53 // 54 // entitiesTreeView54 // networkItemsTreeView 55 55 // 56 this. entitiesTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)56 this.networkItemsTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 57 57 | System.Windows.Forms.AnchorStyles.Left) 58 58 | System.Windows.Forms.AnchorStyles.Right))); 59 this. entitiesTreeView.HideSelection = false;60 this. entitiesTreeView.ImageIndex = 0;61 this. entitiesTreeView.ImageList = this.imageList;62 this. entitiesTreeView.Location = new System.Drawing.Point(6, 19);63 this. entitiesTreeView.Name = "entitiesTreeView";64 this. entitiesTreeView.SelectedImageIndex = 0;65 this. entitiesTreeView.ShowNodeToolTips = true;66 this. entitiesTreeView.Size = new System.Drawing.Size(333, 263);67 this. entitiesTreeView.TabIndex = 0;68 this. entitiesTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.entitiesTreeView_AfterSelect);59 this.networkItemsTreeView.HideSelection = false; 60 this.networkItemsTreeView.ImageIndex = 0; 61 this.networkItemsTreeView.ImageList = this.imageList; 62 this.networkItemsTreeView.Location = new System.Drawing.Point(6, 19); 63 this.networkItemsTreeView.Name = "networkItemsTreeView"; 64 this.networkItemsTreeView.SelectedImageIndex = 0; 65 this.networkItemsTreeView.ShowNodeToolTips = true; 66 this.networkItemsTreeView.Size = new System.Drawing.Size(333, 263); 67 this.networkItemsTreeView.TabIndex = 0; 68 this.networkItemsTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.networkItemsTreeView_AfterSelect); 69 69 // 70 // entitiesGroupBox70 // networkItemsGroupBox 71 71 // 72 this. entitiesGroupBox.Controls.Add(this.entitiesTreeView);73 this. entitiesGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;74 this. entitiesGroupBox.Location = new System.Drawing.Point(0, 0);75 this. entitiesGroupBox.Name = "entitiesGroupBox";76 this. entitiesGroupBox.Size = new System.Drawing.Size(345, 288);77 this. entitiesGroupBox.TabIndex = 0;78 this. entitiesGroupBox.TabStop = false;79 this. entitiesGroupBox.Text = "Network Entities";72 this.networkItemsGroupBox.Controls.Add(this.networkItemsTreeView); 73 this.networkItemsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; 74 this.networkItemsGroupBox.Location = new System.Drawing.Point(0, 0); 75 this.networkItemsGroupBox.Name = "networkItemsGroupBox"; 76 this.networkItemsGroupBox.Size = new System.Drawing.Size(345, 288); 77 this.networkItemsGroupBox.TabIndex = 0; 78 this.networkItemsGroupBox.TabStop = false; 79 this.networkItemsGroupBox.Text = "Network Items"; 80 80 // 81 81 // imageList … … 85 85 this.imageList.TransparentColor = System.Drawing.Color.Transparent; 86 86 // 87 // EntitySelector87 // NetworkItemSelector 88 88 // 89 89 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 90 90 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 91 this.Controls.Add(this. entitiesGroupBox);92 this.Name = " EntitySelector";91 this.Controls.Add(this.networkItemsGroupBox); 92 this.Name = "NetworkItemSelector"; 93 93 this.Size = new System.Drawing.Size(345, 288); 94 this. entitiesGroupBox.ResumeLayout(false);94 this.networkItemsGroupBox.ResumeLayout(false); 95 95 this.ResumeLayout(false); 96 96 … … 99 99 #endregion 100 100 101 protected System.Windows.Forms.GroupBox entitiesGroupBox;102 protected System.Windows.Forms.TreeView entitiesTreeView;101 protected System.Windows.Forms.GroupBox networkItemsGroupBox; 102 protected System.Windows.Forms.TreeView networkItemsTreeView; 103 103 protected System.Windows.Forms.ImageList imageList; 104 104 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/NetworkItemSelector.cs
r11527 r11528 25 25 26 26 namespace HeuristicLab.Core.Networks.Views { 27 public partial class EntitySelector : UserControl {28 protected Func<I Entity, bool> entityCondition;29 protected I Entityroot;30 public I EntityRoot {27 public partial class NetworkItemSelector : UserControl { 28 protected Func<INetworkItem, bool> networkItemCondition; 29 protected INetworkItem root; 30 public INetworkItem Root { 31 31 get { return root; } 32 32 } 33 33 public string Caption { 34 get { return entitiesGroupBox.Text; }34 get { return networkItemsGroupBox.Text; } 35 35 set { 36 36 if (InvokeRequired) 37 37 Invoke(new Action<string>(s => { Caption = s; }), value); 38 38 else 39 entitiesGroupBox.Text = value;39 networkItemsGroupBox.Text = value; 40 40 } 41 41 } 42 public TreeView EntitiesTreeView {43 get { return entitiesTreeView; }42 public TreeView NetworkItemsTreeView { 43 get { return networkItemsTreeView; } 44 44 } 45 protected I Entity selectedEntity;46 public I Entity SelectedEntity{45 protected INetworkItem selectedNetworkItem; 46 public INetworkItem SelectedNetworkItem { 47 47 get { 48 return selected Entity;48 return selectedNetworkItem; 49 49 } 50 50 protected set { 51 if (selected Entity!= value) {52 selected Entity= value;53 OnSelected EntityChanged();51 if (selectedNetworkItem != value) { 52 selectedNetworkItem = value; 53 OnSelectedNetworkItemChanged(); 54 54 } 55 55 } 56 56 } 57 57 58 public EntitySelector() {58 public NetworkItemSelector() { 59 59 InitializeComponent(); 60 60 root = null; 61 entityCondition = null;62 selected Entity= null;61 networkItemCondition = null; 62 selectedNetworkItem = null; 63 63 } 64 64 65 public virtual void Configure(I Entityroot) {65 public virtual void Configure(INetworkItem root) { 66 66 Configure(root, null, (e) => true); 67 67 } 68 public virtual void Configure(I Entity root, IEntity selectedEntity) {69 Configure(root, selected Entity, (e) => true);68 public virtual void Configure(INetworkItem root, INetworkItem selectedNetworkItem) { 69 Configure(root, selectedNetworkItem, (e) => true); 70 70 } 71 public virtual void Configure(I Entity root, IEntity selectedEntity, Type entityType) {72 Configure(root, selected Entity, (e) => { return entityType.IsAssignableFrom(e.GetType()); });71 public virtual void Configure(INetworkItem root, INetworkItem selectedNetworkItem, Type networkItemType) { 72 Configure(root, selectedNetworkItem, (e) => { return networkItemType.IsAssignableFrom(e.GetType()); }); 73 73 } 74 public virtual void Configure(I Entity root, IEntity selectedEntity, Func<IEntity, bool> entityCondition) {74 public virtual void Configure(INetworkItem root, INetworkItem selectedNetworkItem, Func<INetworkItem, bool> networkItemCondition) { 75 75 if (root == null) throw new ArgumentNullException("root"); 76 if ( entityCondition == null) throw new ArgumentNullException("entityCondition");76 if (networkItemCondition == null) throw new ArgumentNullException("networkItemCondition"); 77 77 if (InvokeRequired) 78 Invoke(new Action<I Entity, IEntity, Func<IEntity, bool>>(Configure), root, selectedEntity, entityCondition);78 Invoke(new Action<INetworkItem, INetworkItem, Func<INetworkItem, bool>>(Configure), root, selectedNetworkItem, networkItemCondition); 79 79 else { 80 80 this.root = root; 81 this. entityCondition = entityCondition;82 this.selected Entity= null;83 entitiesTreeView.Nodes.Clear();81 this.networkItemCondition = networkItemCondition; 82 this.selectedNetworkItem = null; 83 networkItemsTreeView.Nodes.Clear(); 84 84 imageList.Images.Clear(); 85 85 86 86 TreeNode selectedNode; 87 var n = CreateTreeNode(Root, selected Entity, entityCondition, out selectedNode);87 var n = CreateTreeNode(Root, selectedNetworkItem, networkItemCondition, out selectedNode); 88 88 if (n != null) 89 entitiesTreeView.Nodes.Add(n);89 networkItemsTreeView.Nodes.Add(n); 90 90 if (selectedNode != null) { 91 entitiesTreeView.SelectedNode = selectedNode;91 networkItemsTreeView.SelectedNode = selectedNode; 92 92 selectedNode.EnsureVisible(); 93 93 } … … 95 95 } 96 96 97 public event EventHandler Selected EntityChanged;98 protected virtual void OnSelected EntityChanged() {99 var handler = Selected EntityChanged;100 if (handler != null) Selected EntityChanged(this, EventArgs.Empty);97 public event EventHandler SelectedNetworkItemChanged; 98 protected virtual void OnSelectedNetworkItemChanged() { 99 var handler = SelectedNetworkItemChanged; 100 if (handler != null) SelectedNetworkItemChanged(this, EventArgs.Empty); 101 101 } 102 102 103 103 #region Control Events 104 protected virtual void entitiesTreeView_AfterSelect(object sender, TreeViewEventArgs e) {105 if ( entitiesTreeView.SelectedNode == null)106 Selected Entity= null;104 protected virtual void networkItemsTreeView_AfterSelect(object sender, TreeViewEventArgs e) { 105 if (networkItemsTreeView.SelectedNode == null) 106 SelectedNetworkItem = null; 107 107 else { 108 var selected = (I Entity)entitiesTreeView.SelectedNode.Tag;109 Selected Entity = ((entityCondition != null) && !entityCondition(selected)) ? null : selected;108 var selected = (INetworkItem)networkItemsTreeView.SelectedNode.Tag; 109 SelectedNetworkItem = ((networkItemCondition != null) && !networkItemCondition(selected)) ? null : selected; 110 110 } 111 111 } … … 113 113 114 114 #region Helpers 115 protected virtual TreeNode CreateTreeNode(I Entity entity, IEntity selectedEntity, Func<IEntity, bool> entityCondition, out TreeNode selectedNode) {115 protected virtual TreeNode CreateTreeNode(INetworkItem networkItem, INetworkItem selectedNetworkItem, Func<INetworkItem, bool> networkItemCondition, out TreeNode selectedNode) { 116 116 selectedNode = null; 117 if ( entity== null) return null;117 if (networkItem == null) return null; 118 118 119 TreeNode node = new TreeNode( entity.Name);120 node.Tag = entity;121 foreach (var child in entity.Children) {119 TreeNode node = new TreeNode(networkItem.Name); 120 node.Tag = networkItem; 121 foreach (var child in networkItem.Children) { 122 122 TreeNode selected; 123 var n = CreateTreeNode(child, selected Entity, entityCondition, out selected);123 var n = CreateTreeNode(child, selectedNetworkItem, networkItemCondition, out selected); 124 124 if (n != null) { 125 125 node.Nodes.Add(n); … … 128 128 129 129 } 130 if (! entityCondition(entity) && (node.Nodes.Count == 0))130 if (!networkItemCondition(networkItem) && (node.Nodes.Count == 0)) 131 131 return null; 132 132 133 imageList.Images.Add( entity.ItemImage);133 imageList.Images.Add(networkItem.ItemImage); 134 134 node.ImageIndex = imageList.Images.Count - 1; 135 135 node.SelectedImageIndex = node.ImageIndex; 136 node.ToolTipText = entity.GetType().GetPrettyName();136 node.ToolTipText = networkItem.GetType().GetPrettyName(); 137 137 138 if ( entity == selectedEntity) selectedNode = node;138 if (networkItem == selectedNetworkItem) selectedNode = node; 139 139 return node; 140 140 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/NetworkItemSelectorDialog.Designer.cs
r11527 r11528 21 21 22 22 namespace HeuristicLab.Core.Networks.Views { 23 partial class EntitySelectorDialog {23 partial class NetworkItemSelectorDialog { 24 24 /// <summary> 25 25 /// Required designer variable. … … 47 47 this.okButton = new System.Windows.Forms.Button(); 48 48 this.cancelButton = new System.Windows.Forms.Button(); 49 this. entitySelector = new HeuristicLab.Core.Networks.Views.EntitySelector();49 this.networkItemSelector = new HeuristicLab.Core.Networks.Views.NetworkItemSelector(); 50 50 this.SuspendLayout(); 51 51 // … … 72 72 this.cancelButton.UseVisualStyleBackColor = true; 73 73 // 74 // entitySelector74 // networkItemSelector 75 75 // 76 this. entitySelector.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)76 this.networkItemSelector.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 77 77 | System.Windows.Forms.AnchorStyles.Left) 78 78 | System.Windows.Forms.AnchorStyles.Right))); 79 this. entitySelector.Caption = "Network Entities";80 this. entitySelector.Location = new System.Drawing.Point(12, 12);81 this. entitySelector.Name = "entitySelector";82 this. entitySelector.Size = new System.Drawing.Size(464, 391);83 this. entitySelector.TabIndex = 1;84 this. entitySelector.SelectedEntityChanged += new System.EventHandler(this.entitySelector_SelectedEntityChanged);79 this.networkItemSelector.Caption = "Network Items"; 80 this.networkItemSelector.Location = new System.Drawing.Point(12, 12); 81 this.networkItemSelector.Name = "networkItemSelector"; 82 this.networkItemSelector.Size = new System.Drawing.Size(464, 391); 83 this.networkItemSelector.TabIndex = 1; 84 this.networkItemSelector.SelectedNetworkItemChanged += new System.EventHandler(this.networkItemSelector_SelectedNetworkItemChanged); 85 85 // 86 // EntitySelectorDialog86 // NetworkItemSelectorDialog 87 87 // 88 88 this.AcceptButton = this.okButton; … … 91 91 this.CancelButton = this.cancelButton; 92 92 this.ClientSize = new System.Drawing.Size(488, 444); 93 this.Controls.Add(this. entitySelector);93 this.Controls.Add(this.networkItemSelector); 94 94 this.Controls.Add(this.cancelButton); 95 95 this.Controls.Add(this.okButton); 96 96 this.MaximizeBox = false; 97 97 this.MinimizeBox = false; 98 this.Name = " EntitySelectorDialog";98 this.Name = "NetworkItemSelectorDialog"; 99 99 this.ShowIcon = false; 100 100 this.ShowInTaskbar = false; 101 101 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 102 this.Text = "Select Entity";103 this.Load += new System.EventHandler(this. EntitySelectorDialog_Load);104 this.Shown += new System.EventHandler(this. EntitySelectorDialog_Shown);102 this.Text = "Select Network Item"; 103 this.Load += new System.EventHandler(this.NetworkItemSelectorDialog_Load); 104 this.Shown += new System.EventHandler(this.NetworkItemSelectorDialog_Shown); 105 105 this.ResumeLayout(false); 106 106 … … 111 111 protected System.Windows.Forms.Button okButton; 112 112 protected System.Windows.Forms.Button cancelButton; 113 protected EntitySelector entitySelector;113 protected NetworkItemSelector networkItemSelector; 114 114 115 115 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/NetworkItemSelectorDialog.cs
r11527 r11528 24 24 25 25 namespace HeuristicLab.Core.Networks.Views { 26 public partial class EntitySelectorDialog : Form {26 public partial class NetworkItemSelectorDialog : Form { 27 27 public string Caption { 28 28 get { return Text; } … … 34 34 } 35 35 } 36 public EntitySelector EntitySelector {37 get { return entitySelector; }36 public NetworkItemSelector NetworkItemSelector { 37 get { return networkItemSelector; } 38 38 } 39 39 40 public EntitySelectorDialog() {40 public NetworkItemSelectorDialog() { 41 41 InitializeComponent(); 42 okButton.Enabled = entitySelector.SelectedEntity!= null;42 okButton.Enabled = networkItemSelector.SelectedNetworkItem != null; 43 43 } 44 protected virtual void EntitySelectorDialog_Load(object sender, EventArgs e) {45 this. entitySelector.EntitiesTreeView.DoubleClick += new System.EventHandler(EntitiesTreeView_DoubleClick);44 protected virtual void NetworkItemSelectorDialog_Load(object sender, EventArgs e) { 45 this.networkItemSelector.NetworkItemsTreeView.DoubleClick += new System.EventHandler(NetworkItemsTreeView_DoubleClick); 46 46 } 47 protected virtual void EntitySelectorDialog_Shown(object sender, EventArgs e) {48 okButton.Enabled = entitySelector.SelectedEntity!= null;47 protected virtual void NetworkItemSelectorDialog_Shown(object sender, EventArgs e) { 48 okButton.Enabled = networkItemSelector.SelectedNetworkItem != null; 49 49 } 50 protected virtual void entitySelector_SelectedEntityChanged(object sender, EventArgs e) {51 okButton.Enabled = entitySelector.SelectedEntity!= null;50 protected virtual void networkItemSelector_SelectedNetworkItemChanged(object sender, EventArgs e) { 51 okButton.Enabled = networkItemSelector.SelectedNetworkItem != null; 52 52 } 53 protected virtual void EntitiesTreeView_DoubleClick(object sender, System.EventArgs e) {54 if ( entitySelector.SelectedEntity!= null) {53 protected virtual void NetworkItemsTreeView_DoubleClick(object sender, System.EventArgs e) { 54 if (networkItemSelector.SelectedNetworkItem != null) { 55 55 DialogResult = DialogResult.OK; 56 56 Close(); -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/NetworkItemView.Designer.cs
r11527 r11528 21 21 22 22 namespace HeuristicLab.Core.Networks.Views { 23 partial class EntityView {23 partial class NetworkItemView { 24 24 /// <summary> 25 25 /// Required designer variable. … … 59 59 this.infoLabel.Location = new System.Drawing.Point(626, 3); 60 60 // 61 // EntityView61 // NetworkItemView 62 62 // 63 63 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 64 this.Name = " EntityView";64 this.Name = "NetworkItemView"; 65 65 this.Size = new System.Drawing.Size(645, 517); 66 66 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/NetworkItemView.cs
r11527 r11528 26 26 27 27 namespace HeuristicLab.Core.Networks.Views { 28 [View(" EntityView")]29 [Content(typeof( Entity), true)]30 [Content(typeof(I Entity), false)]31 public partial class EntityView : NamedItemView {32 public new I EntityContent {33 get { return (I Entity)base.Content; }28 [View("NetworkItem View")] 29 [Content(typeof(NetworkItem), true)] 30 [Content(typeof(INetworkItem), false)] 31 public partial class NetworkItemView : NamedItemView { 32 public new INetworkItem Content { 33 get { return (INetworkItem)base.Content; } 34 34 set { base.Content = value; } 35 35 } 36 36 37 public EntityView() {37 public NetworkItemView() { 38 38 InitializeComponent(); 39 39 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/NetworkView.cs
r11526 r11528 27 27 [Content(typeof(Network), true)] 28 28 [Content(typeof(INetwork), false)] 29 public partial class NetworkView : EntityView {29 public partial class NetworkView : NetworkItemView { 30 30 public new INetwork Content { 31 31 get { return (INetwork)base.Content; } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/NodeView.cs
r11526 r11528 27 27 [Content(typeof(Node), true)] 28 28 [Content(typeof(INode), false)] 29 public partial class NodeView : EntityView {29 public partial class NodeView : NetworkItemView { 30 30 public new INode Content { 31 31 get { return (INode)base.Content; } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/PortParameterView.cs
r11526 r11528 32 32 [Content(typeof(IPortParameter<>), false)] 33 33 [Content(typeof(IPortParameter), false)] 34 public partial class PortParameterView : EntityView {34 public partial class PortParameterView : NetworkItemView { 35 35 protected TypeSelectorDialog typeSelectorDialog; 36 36 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/PortView.cs
r11526 r11528 27 27 [Content(typeof(Port), true)] 28 28 [Content(typeof(IPort), false)] 29 public partial class PortView : EntityView {29 public partial class PortView : NetworkItemView { 30 30 public new IPort Content { 31 31 get { return (IPort)base.Content; } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/HeuristicLab.Optimization.Networks.Views-3.3.csproj
r11526 r11528 91 91 </ItemGroup> 92 92 <ItemGroup> 93 <Compile Include="Core.Networks.Views\EntitySelector.cs">94 <SubType>UserControl</SubType>95 </Compile>96 <Compile Include="Core.Networks.Views\EntitySelector.Designer.cs">97 <DependentUpon>EntitySelector.cs</DependentUpon>98 </Compile>99 <Compile Include="Core.Networks.Views\EntitySelectorDialog.cs">100 <SubType>Form</SubType>101 </Compile>102 <Compile Include="Core.Networks.Views\EntitySelectorDialog.Designer.cs">103 <DependentUpon>EntitySelectorDialog.cs</DependentUpon>104 </Compile>105 <Compile Include="Core.Networks.Views\EntityView.cs">106 <SubType>UserControl</SubType>107 </Compile>108 <Compile Include="Core.Networks.Views\EntityView.Designer.cs">109 <DependentUpon>EntityView.cs</DependentUpon>110 </Compile>111 93 <Compile Include="Core.Networks.Views\GenericNodeView.cs"> 112 94 <SubType>UserControl</SubType> … … 144 126 <Compile Include="Core.Networks.Views\MessageView.Designer.cs"> 145 127 <DependentUpon>MessageView.cs</DependentUpon> 128 </Compile> 129 <Compile Include="Core.Networks.Views\NetworkItemSelector.cs"> 130 <SubType>UserControl</SubType> 131 </Compile> 132 <Compile Include="Core.Networks.Views\NetworkItemSelector.Designer.cs"> 133 <DependentUpon>NetworkItemSelector.cs</DependentUpon> 134 </Compile> 135 <Compile Include="Core.Networks.Views\NetworkItemSelectorDialog.cs"> 136 <SubType>Form</SubType> 137 </Compile> 138 <Compile Include="Core.Networks.Views\NetworkItemSelectorDialog.Designer.cs"> 139 <DependentUpon>NetworkItemSelectorDialog.cs</DependentUpon> 140 </Compile> 141 <Compile Include="Core.Networks.Views\NetworkItemView.cs"> 142 <SubType>UserControl</SubType> 143 </Compile> 144 <Compile Include="Core.Networks.Views\NetworkItemView.Designer.cs"> 145 <DependentUpon>NetworkItemView.cs</DependentUpon> 146 146 </Compile> 147 147 <Compile Include="Core.Networks.Views\NetworkView.cs"> -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Optimization.Networks.Views/AlgorithmNodeView.cs
r11526 r11528 31 31 [Content(typeof(AlgorithmNode), true)] 32 32 [Content(typeof(IAlgorithmNode), false)] 33 public partial class AlgorithmNodeView : EntityView {33 public partial class AlgorithmNodeView : NetworkItemView { 34 34 protected TypeSelectorDialog typeSelectorDialog; 35 35 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/ClassDiagram.cd
r11527 r11528 1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <ClassDiagram MajorVersion="1" MinorVersion="1"> 3 <Class Name="HeuristicLab.Core.Networks.Entity" Collapsed="true">4 <Position X="7.75" Y="0.5" Width="1.5" />5 <TypeIdentifier>6 <HashCode>AAAiAACAAAAAQAJAAAAEQQAAAAAAQAAAAAAAAAAEAEQ=</HashCode>7 <FileName>Core.Networks\Entity.cs</FileName>8 </TypeIdentifier>9 <Lollipop Position="0.2" />10 </Class>11 3 <Class Name="HeuristicLab.Core.Networks.GenericNode" Collapsed="true"> 12 4 <Position X="1" Y="3.5" Width="1.5" /> … … 63 55 <Lollipop Position="0.2" /> 64 56 </Class> 57 <Class Name="HeuristicLab.Core.Networks.NetworkItem" Collapsed="true"> 58 <Position X="7.75" Y="0.5" Width="1.5" /> 59 <TypeIdentifier> 60 <HashCode>AAAiAACAAAAAQAJAAAAEQQAAAAAAQAAAAAAAAAAEAEQ=</HashCode> 61 <FileName>Core.Networks\NetworkItem.cs</FileName> 62 </TypeIdentifier> 63 <Lollipop Position="0.2" /> 64 </Class> 65 65 <Class Name="HeuristicLab.Core.Networks.Node" Collapsed="true"> 66 66 <Position X="4.5" Y="2" Width="1.5" /> … … 170 170 </Class> 171 171 <Interface Name="HeuristicLab.Core.Networks.IConnectedPort" Collapsed="true"> 172 <Position X=" 10" Y="11.75" Width="1.5" />172 <Position X="7.75" Y="11.75" Width="1.5" /> 173 173 <TypeIdentifier> 174 174 <HashCode>AAAAAAAAAAAAAAQAAAAAAAAAACAAAAAAAAAAAAAAAAA=</HashCode> … … 176 176 </TypeIdentifier> 177 177 </Interface> 178 <Interface Name="HeuristicLab.Core.Networks.IEntity" Collapsed="true">179 <Position X="7.75" Y="7.5" Width="1.5" />180 <TypeIdentifier>181 <HashCode>AAAAAAAAAAAAAAIAAAAEQAAAAAAAAAAAAAAAAAAAAAQ=</HashCode>182 <FileName>Core.Networks\IEntity.cs</FileName>183 </TypeIdentifier>184 </Interface>185 178 <Interface Name="HeuristicLab.Core.Networks.IGenericNode" Collapsed="true"> 186 <Position X=" 5.5" Y="10.5" Width="1.5" />179 <Position X="3.25" Y="10.5" Width="1.5" /> 187 180 <TypeIdentifier> 188 181 <HashCode>AAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode> … … 191 184 </Interface> 192 185 <Interface Name="HeuristicLab.Core.Networks.IGenericPort" Collapsed="true"> 193 <Position X="1 3.5" Y="11.75" Width="1.5" />186 <Position X="11.25" Y="11.75" Width="1.5" /> 194 187 <TypeIdentifier> 195 188 <HashCode>ARAAMAAAQAAAACABACAAAAAAAgQAAAAAAAAACQAAAAQ=</HashCode> … … 219 212 </Interface> 220 213 <Interface Name="HeuristicLab.Core.Networks.INetwork" Collapsed="true"> 221 <Position X=" 3.25" Y="10.5" Width="1.5" />214 <Position X="1" Y="10.5" Width="1.5" /> 222 215 <TypeIdentifier> 223 216 <HashCode>AAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode> … … 225 218 </TypeIdentifier> 226 219 </Interface> 220 <Interface Name="HeuristicLab.Core.Networks.INetworkItem" Collapsed="true"> 221 <Position X="7.75" Y="7.5" Width="1.5" /> 222 <TypeIdentifier> 223 <HashCode>AAAAAAAAAAAAAAIAAAAEQAAAAAAAAAAAAAAAAAAAAAQ=</HashCode> 224 <FileName>Core.Networks\INetworkItem.cs</FileName> 225 </TypeIdentifier> 226 </Interface> 227 227 <Interface Name="HeuristicLab.Core.Networks.INode" Collapsed="true"> 228 <Position X=" 5.5" Y="9" Width="1.5" />228 <Position X="3.25" Y="9" Width="1.5" /> 229 229 <TypeIdentifier> 230 230 <HashCode>AAAAAAAAAAAAAAAABAAAQAAAAAAAAAAAAAAAAAAAAAA=</HashCode> … … 233 233 </Interface> 234 234 <Interface Name="HeuristicLab.Core.Networks.IParameterizedPort" Collapsed="true"> 235 <Position X="1 2.25" Y="10.5" Width="1.5" />235 <Position X="10" Y="10.5" Width="1.5" /> 236 236 <TypeIdentifier> 237 237 <HashCode>AAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAA=</HashCode> … … 240 240 </Interface> 241 241 <Interface Name="HeuristicLab.Core.Networks.IPort" Collapsed="true"> 242 <Position X="1 2.25" Y="9" Width="1.5" />242 <Position X="10" Y="9" Width="1.5" /> 243 243 <TypeIdentifier> 244 244 <HashCode>AAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAA=</HashCode> … … 247 247 </Interface> 248 248 <Interface Name="HeuristicLab.Core.Networks.IPortParameter" Collapsed="true"> 249 <Position X="1 " Y="9" Width="1.5" />249 <Position X="14.5" Y="9" Width="1.5" /> 250 250 <TypeIdentifier> 251 251 <HashCode>AAAAAAAAAAIAQAAAAAAAQAAAAADAAAAAEQAAAAAAAAA=</HashCode> … … 254 254 </Interface> 255 255 <Interface Name="HeuristicLab.Core.Networks.IPortParameter<T>" Collapsed="true"> 256 <Position X="1 " Y="10.5" Width="1.5" />256 <Position X="14.5" Y="10.5" Width="1.5" /> 257 257 <TypeIdentifier> 258 258 <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAAAAAAAA=</HashCode> … … 268 268 </Interface> 269 269 <Interface Name="HeuristicLab.Optimization.Networks.IAlgorithmNode" Collapsed="true"> 270 <Position X=" 7.75" Y="10.5" Width="1.5" />270 <Position X="5.5" Y="10.5" Width="1.5" /> 271 271 <TypeIdentifier> 272 272 <HashCode>AAAAAAAAAAAAEAAABAAAQAAAAAAAAAAAAAAAAAQAAAA=</HashCode> … … 275 275 </Interface> 276 276 <Interface Name="HeuristicLab.Optimization.Networks.IConfigurationPort" Collapsed="true"> 277 <Position X="1 2.25" Y="13.25" Width="1.5" />277 <Position X="10" Y="13.25" Width="1.5" /> 278 278 <TypeIdentifier> 279 279 <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode> … … 282 282 </Interface> 283 283 <Interface Name="HeuristicLab.Optimization.Networks.IExecutionPort" Collapsed="true"> 284 <Position X="1 4.5" Y="13.25" Width="1.5" />284 <Position X="12.25" Y="13.25" Width="1.5" /> 285 285 <TypeIdentifier> 286 286 <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode> -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/GenericPort.cs
r11526 r11528 161 161 // collect output parameters from local port 162 162 message.Values.AddRange( 163 Parameters .164 Where(p => p.Type.HasFlag(PortParameterType.Output)).165 Select(p => p.CreateMessageValue())163 Parameters 164 .Where(p => p.Type.HasFlag(PortParameterType.Output)) 165 .Select(p => p.CreateMessageValue()) 166 166 ); 167 167 … … 169 169 if (ConnectedPort != null) { 170 170 message.Values.AddRange( 171 ConnectedPort.Parameters .172 Where(p => p.Type.HasFlag(PortParameterType.Input) && !message.Values.ContainsKey(p.Name)).173 Select(p => p.CreateMessageValue())171 ConnectedPort.Parameters 172 .Where(p => p.Type.HasFlag(PortParameterType.Input) && !message.Values.ContainsKey(p.Name)) 173 .Select(p => p.CreateMessageValue()) 174 174 ); 175 175 } … … 178 178 if (ConnectedPort != null) { 179 179 message.Values.AddRange( 180 ConnectedPort.Parameters .181 Where(p => p.Type.HasFlag(PortParameterType.Output) && !message.Values.ContainsKey(p.Name)).182 Select(p => p.CreateMessageValue())180 ConnectedPort.Parameters 181 .Where(p => p.Type.HasFlag(PortParameterType.Output) && !message.Values.ContainsKey(p.Name)) 182 .Select(p => p.CreateMessageValue()) 183 183 ); 184 184 } … … 186 186 // collect remaining input parameters from local port 187 187 message.Values.AddRange( 188 Parameters .189 Where(p => p.Type.HasFlag(PortParameterType.Input) && !message.Values.ContainsKey(p.Name)).190 Select(p => p.CreateMessageValue())188 Parameters 189 .Where(p => p.Type.HasFlag(PortParameterType.Input) && !message.Values.ContainsKey(p.Name)) 190 .Select(p => p.CreateMessageValue()) 191 191 ); 192 192 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/INetworkItem.cs
r11527 r11528 24 24 25 25 namespace HeuristicLab.Core.Networks { 26 public interface I Entity: INamedItem {27 I EntityParent { get; }28 IEnumerable<I Entity> Children { get; }26 public interface INetworkItem : INamedItem { 27 INetworkItem Parent { get; } 28 IEnumerable<INetworkItem> Children { get; } 29 29 string Path { get; } 30 30 event EventHandler PathChanged; -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/INode.cs
r11526 r11528 21 21 22 22 namespace HeuristicLab.Core.Networks { 23 public interface INode : I Entity{23 public interface INode : INetworkItem { 24 24 new INetwork Parent { get; set; } 25 25 IKeyedItemCollection<string, IPort> Ports { get; } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/IPort.cs
r11526 r11528 21 21 22 22 namespace HeuristicLab.Core.Networks { 23 public interface IPort : I Entity{23 public interface IPort : INetworkItem { 24 24 new INode Parent { get; set; } 25 25 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/IPortParameter.cs
r11526 r11528 23 23 24 24 namespace HeuristicLab.Core.Networks { 25 public interface IPortParameter : I Entity{25 public interface IPortParameter : INetworkItem { 26 26 new IPort Parent { get; set; } 27 27 Type DataType { get; } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/Network.cs
r11526 r11528 37 37 } 38 38 39 public override IEnumerable<I Entity> Children {40 get { return base.Children.Concat(Nodes.AsEnumerable<I Entity>()); }39 public override IEnumerable<INetworkItem> Children { 40 get { return base.Children.Concat(Nodes.AsEnumerable<INetworkItem>()); } 41 41 } 42 42 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/NetworkItem.cs
r11527 r11528 28 28 29 29 namespace HeuristicLab.Core.Networks { 30 [Item(" Entity", "Abstract base class for entities of an optimizationnetwork.")]30 [Item("NetworkItem", "Abstract base class for items of a network.")] 31 31 [StorableClass] 32 public abstract class Entity : NamedItem, IEntity{32 public abstract class NetworkItem : NamedItem, INetworkItem { 33 33 public static readonly string PathSeparator = " => "; 34 34 public static new Image StaticItemImage { … … 36 36 } 37 37 38 private I Entityparent;39 public I EntityParent {38 private INetworkItem parent; 39 public INetworkItem Parent { 40 40 get { return parent; } 41 41 protected set { … … 48 48 } 49 49 } 50 public virtual IEnumerable<I Entity> Children {51 get { return Enumerable.Empty<I Entity>(); }50 public virtual IEnumerable<INetworkItem> Children { 51 get { return Enumerable.Empty<INetworkItem>(); } 52 52 } 53 53 public string Path { … … 58 58 59 59 [StorableConstructor] 60 protected Entity(bool deserializing) : base(deserializing) { }61 protected Entity(Entityoriginal, Cloner cloner) : base(original, cloner) { }62 protected Entity() : base("Entity") { }63 protected Entity(string name) : base(name) { }64 protected Entity(string name, string description) : base(name, description) { }60 protected NetworkItem(bool deserializing) : base(deserializing) { } 61 protected NetworkItem(NetworkItem original, Cloner cloner) : base(original, cloner) { } 62 protected NetworkItem() : base("NetworkItem") { } 63 protected NetworkItem(string name) : base(name) { } 64 protected NetworkItem(string name, string description) : base(name, description) { } 65 65 66 66 protected override void OnNameChanging(CancelEventArgs<string> e) { -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/Node.cs
r11526 r11528 29 29 [Item("Node", "A node of an optimization network.")] 30 30 [StorableClass] 31 public class Node : Entity, INode {31 public class Node : NetworkItem, INode { 32 32 public static new Image StaticItemImage { 33 33 get { return HeuristicLab.Common.Resources.VSImageLibrary.RadialChart; } … … 41 41 } 42 42 } 43 public override IEnumerable<I Entity> Children {44 get { return base.Children.Concat(Ports.AsEnumerable<I Entity>()); }43 public override IEnumerable<INetworkItem> Children { 44 get { return base.Children.Concat(Ports.AsEnumerable<INetworkItem>()); } 45 45 } 46 46 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ParameterizedPort.cs
r11526 r11528 30 30 [StorableClass] 31 31 public abstract class ParameterizedPort : Port, IParameterizedPort { 32 public override IEnumerable<I Entity> Children {33 get { return base.Children.Concat(Parameters.AsEnumerable<I Entity>()); }32 public override IEnumerable<INetworkItem> Children { 33 get { return base.Children.Concat(Parameters.AsEnumerable<INetworkItem>()); } 34 34 } 35 35 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/Port.cs
r11526 r11528 27 27 [Item("Port", "Abstract base class for ports of an optimization network node.")] 28 28 [StorableClass] 29 public abstract class Port : Entity, IPort {29 public abstract class Port : NetworkItem, IPort { 30 30 public static new Image StaticItemImage { 31 31 get { return HeuristicLab.Common.Resources.VSImageLibrary.Field; } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/PortParameter.cs
r11526 r11528 28 28 [Item("PortParameter", "A parameter of a port.")] 29 29 [StorableClass] 30 public class PortParameter<T> : Entity, IPortParameter<T> where T : class, IItem {30 public class PortParameter<T> : NetworkItem, IPortParameter<T> where T : class, IItem { 31 31 public static new Image StaticItemImage { 32 32 get { return HeuristicLab.Common.Resources.VSImageLibrary.Field; } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/HeuristicLab.Optimization.Networks-3.3.csproj
r11526 r11528 90 90 </ItemGroup> 91 91 <ItemGroup> 92 <Compile Include="Core.Networks\Entity.cs" />93 92 <Compile Include="Core.Networks\GenericNode.cs" /> 94 93 <Compile Include="Core.Networks\GenericPort.cs" /> 95 94 <Compile Include="Core.Networks\IConnectedPort.cs" /> 96 <Compile Include="Core.Networks\IEntity.cs" />97 95 <Compile Include="Core.Networks\IGenericNode.cs" /> 98 96 <Compile Include="Core.Networks\IGenericPort.cs" /> … … 100 98 <Compile Include="Core.Networks\IMessageValue.cs" /> 101 99 <Compile Include="Core.Networks\INetwork.cs" /> 100 <Compile Include="Core.Networks\INetworkItem.cs" /> 102 101 <Compile Include="Core.Networks\INode.cs" /> 103 102 <Compile Include="Core.Networks\IParameterizedPort.cs" /> … … 109 108 <Compile Include="Core.Networks\MessageValueCollection.cs" /> 110 109 <Compile Include="Core.Networks\Network.cs" /> 110 <Compile Include="Core.Networks\NetworkItem.cs" /> 111 111 <Compile Include="Core.Networks\Node.cs" /> 112 112 <Compile Include="Core.Networks\NodeCollection.cs" />
Note: See TracChangeset
for help on using the changeset viewer.