Changeset 11528


Ignore:
Timestamp:
11/10/14 01:42:42 (8 years ago)
Author:
swagner
Message:

#2205: Implemented review comments

  • adapted formatting of multi-line LINQ queries
  • renamed Entity to NetworkItem
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  
    3030  [Content(typeof(IGenericPort), false)]
    3131  public partial class GenericPortView : PortView {
    32     protected EntitySelectorDialog entitySelectorDialog;
     32    protected NetworkItemSelectorDialog networkItemSelectorDialog;
    3333
    3434    public new IGenericPort Content {
     
    4545    protected override void Dispose(bool disposing) {
    4646      if (disposing) {
    47         if (entitySelectorDialog != null) entitySelectorDialog.Dispose();
     47        if (networkItemSelectorDialog != null) networkItemSelectorDialog.Dispose();
    4848        if (components != null) components.Dispose();
    4949      }
     
    114114
    115115    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";
    120120      }
    121121
    122122      try {
    123         IEntity root = Content;
     123        INetworkItem root = Content;
    124124        while (root.Parent != null)
    125125          root = root.Parent;
    126         entitySelectorDialog.EntitySelector.Configure(
     126        networkItemSelectorDialog.NetworkItemSelector.Configure(
    127127          root,
    128128          Content.ConnectedPort,
     
    130130        );
    131131
    132         if (entitySelectorDialog.ShowDialog(this) == DialogResult.OK) {
    133           Content.ConnectedPort = entitySelectorDialog.EntitySelector.SelectedEntity as IConnectedPort;
     132        if (networkItemSelectorDialog.ShowDialog(this) == DialogResult.OK) {
     133          Content.ConnectedPort = networkItemSelectorDialog.NetworkItemSelector.SelectedNetworkItem as IConnectedPort;
    134134        }
    135135      }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/NetworkItemSelector.Designer.cs

    r11527 r11528  
    2121
    2222namespace HeuristicLab.Core.Networks.Views {
    23   partial class EntitySelector {
     23  partial class NetworkItemSelector {
    2424    /// <summary>
    2525    /// Required designer variable.
     
    4646    private void InitializeComponent() {
    4747      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();
    5050      this.imageList = new System.Windows.Forms.ImageList(this.components);
    51       this.entitiesGroupBox.SuspendLayout();
     51      this.networkItemsGroupBox.SuspendLayout();
    5252      this.SuspendLayout();
    5353      //
    54       // entitiesTreeView
     54      // networkItemsTreeView
    5555      //
    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)
    5757            | System.Windows.Forms.AnchorStyles.Left)
    5858            | 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);
    6969      //
    70       // entitiesGroupBox
     70      // networkItemsGroupBox
    7171      //
    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";
    8080      //
    8181      // imageList
     
    8585      this.imageList.TransparentColor = System.Drawing.Color.Transparent;
    8686      //
    87       // EntitySelector
     87      // NetworkItemSelector
    8888      //
    8989      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    9090      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";
    9393      this.Size = new System.Drawing.Size(345, 288);
    94       this.entitiesGroupBox.ResumeLayout(false);
     94      this.networkItemsGroupBox.ResumeLayout(false);
    9595      this.ResumeLayout(false);
    9696
     
    9999    #endregion
    100100
    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;
    103103    protected System.Windows.Forms.ImageList imageList;
    104104
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/NetworkItemSelector.cs

    r11527 r11528  
    2525
    2626namespace HeuristicLab.Core.Networks.Views {
    27   public partial class EntitySelector : UserControl {
    28     protected Func<IEntity, bool> entityCondition;
    29     protected IEntity root;
    30     public IEntity Root {
     27  public partial class NetworkItemSelector : UserControl {
     28    protected Func<INetworkItem, bool> networkItemCondition;
     29    protected INetworkItem root;
     30    public INetworkItem Root {
    3131      get { return root; }
    3232    }
    3333    public string Caption {
    34       get { return entitiesGroupBox.Text; }
     34      get { return networkItemsGroupBox.Text; }
    3535      set {
    3636        if (InvokeRequired)
    3737          Invoke(new Action<string>(s => { Caption = s; }), value);
    3838        else
    39           entitiesGroupBox.Text = value;
     39          networkItemsGroupBox.Text = value;
    4040      }
    4141    }
    42     public TreeView EntitiesTreeView {
    43       get { return entitiesTreeView; }
     42    public TreeView NetworkItemsTreeView {
     43      get { return networkItemsTreeView; }
    4444    }
    45     protected IEntity selectedEntity;
    46     public IEntity SelectedEntity {
     45    protected INetworkItem selectedNetworkItem;
     46    public INetworkItem SelectedNetworkItem {
    4747      get {
    48         return selectedEntity;
     48        return selectedNetworkItem;
    4949      }
    5050      protected set {
    51         if (selectedEntity != value) {
    52           selectedEntity = value;
    53           OnSelectedEntityChanged();
     51        if (selectedNetworkItem != value) {
     52          selectedNetworkItem = value;
     53          OnSelectedNetworkItemChanged();
    5454        }
    5555      }
    5656    }
    5757
    58     public EntitySelector() {
     58    public NetworkItemSelector() {
    5959      InitializeComponent();
    6060      root = null;
    61       entityCondition = null;
    62       selectedEntity = null;
     61      networkItemCondition = null;
     62      selectedNetworkItem = null;
    6363    }
    6464
    65     public virtual void Configure(IEntity root) {
     65    public virtual void Configure(INetworkItem root) {
    6666      Configure(root, null, (e) => true);
    6767    }
    68     public virtual void Configure(IEntity root, IEntity selectedEntity) {
    69       Configure(root, selectedEntity, (e) => true);
     68    public virtual void Configure(INetworkItem root, INetworkItem selectedNetworkItem) {
     69      Configure(root, selectedNetworkItem, (e) => true);
    7070    }
    71     public virtual void Configure(IEntity root, IEntity selectedEntity, Type entityType) {
    72       Configure(root, selectedEntity, (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()); });
    7373    }
    74     public virtual void Configure(IEntity root, IEntity selectedEntity, Func<IEntity, bool> entityCondition) {
     74    public virtual void Configure(INetworkItem root, INetworkItem selectedNetworkItem, Func<INetworkItem, bool> networkItemCondition) {
    7575      if (root == null) throw new ArgumentNullException("root");
    76       if (entityCondition == null) throw new ArgumentNullException("entityCondition");
     76      if (networkItemCondition == null) throw new ArgumentNullException("networkItemCondition");
    7777      if (InvokeRequired)
    78         Invoke(new Action<IEntity, IEntity, Func<IEntity, bool>>(Configure), root, selectedEntity, entityCondition);
     78        Invoke(new Action<INetworkItem, INetworkItem, Func<INetworkItem, bool>>(Configure), root, selectedNetworkItem, networkItemCondition);
    7979      else {
    8080        this.root = root;
    81         this.entityCondition = entityCondition;
    82         this.selectedEntity = null;
    83         entitiesTreeView.Nodes.Clear();
     81        this.networkItemCondition = networkItemCondition;
     82        this.selectedNetworkItem = null;
     83        networkItemsTreeView.Nodes.Clear();
    8484        imageList.Images.Clear();
    8585
    8686        TreeNode selectedNode;
    87         var n = CreateTreeNode(Root, selectedEntity, entityCondition, out selectedNode);
     87        var n = CreateTreeNode(Root, selectedNetworkItem, networkItemCondition, out selectedNode);
    8888        if (n != null)
    89           entitiesTreeView.Nodes.Add(n);
     89          networkItemsTreeView.Nodes.Add(n);
    9090        if (selectedNode != null) {
    91           entitiesTreeView.SelectedNode = selectedNode;
     91          networkItemsTreeView.SelectedNode = selectedNode;
    9292          selectedNode.EnsureVisible();
    9393        }
     
    9595    }
    9696
    97     public event EventHandler SelectedEntityChanged;
    98     protected virtual void OnSelectedEntityChanged() {
    99       var handler = SelectedEntityChanged;
    100       if (handler != null) SelectedEntityChanged(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);
    101101    }
    102102
    103103    #region Control Events
    104     protected virtual void entitiesTreeView_AfterSelect(object sender, TreeViewEventArgs e) {
    105       if (entitiesTreeView.SelectedNode == null)
    106         SelectedEntity = null;
     104    protected virtual void networkItemsTreeView_AfterSelect(object sender, TreeViewEventArgs e) {
     105      if (networkItemsTreeView.SelectedNode == null)
     106        SelectedNetworkItem = null;
    107107      else {
    108         var selected = (IEntity)entitiesTreeView.SelectedNode.Tag;
    109         SelectedEntity = ((entityCondition != null) && !entityCondition(selected)) ? null : selected;
     108        var selected = (INetworkItem)networkItemsTreeView.SelectedNode.Tag;
     109        SelectedNetworkItem = ((networkItemCondition != null) && !networkItemCondition(selected)) ? null : selected;
    110110      }
    111111    }
     
    113113
    114114    #region Helpers
    115     protected virtual TreeNode CreateTreeNode(IEntity 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) {
    116116      selectedNode = null;
    117       if (entity == null) return null;
     117      if (networkItem == null) return null;
    118118
    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) {
    122122        TreeNode selected;
    123         var n = CreateTreeNode(child, selectedEntity, entityCondition, out selected);
     123        var n = CreateTreeNode(child, selectedNetworkItem, networkItemCondition, out selected);
    124124        if (n != null) {
    125125          node.Nodes.Add(n);
     
    128128
    129129      }
    130       if (!entityCondition(entity) && (node.Nodes.Count == 0))
     130      if (!networkItemCondition(networkItem) && (node.Nodes.Count == 0))
    131131        return null;
    132132
    133       imageList.Images.Add(entity.ItemImage);
     133      imageList.Images.Add(networkItem.ItemImage);
    134134      node.ImageIndex = imageList.Images.Count - 1;
    135135      node.SelectedImageIndex = node.ImageIndex;
    136       node.ToolTipText = entity.GetType().GetPrettyName();
     136      node.ToolTipText = networkItem.GetType().GetPrettyName();
    137137
    138       if (entity == selectedEntity) selectedNode = node;
     138      if (networkItem == selectedNetworkItem) selectedNode = node;
    139139      return node;
    140140    }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/NetworkItemSelectorDialog.Designer.cs

    r11527 r11528  
    2121
    2222namespace HeuristicLab.Core.Networks.Views {
    23   partial class EntitySelectorDialog {
     23  partial class NetworkItemSelectorDialog {
    2424    /// <summary>
    2525    /// Required designer variable.
     
    4747      this.okButton = new System.Windows.Forms.Button();
    4848      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();
    5050      this.SuspendLayout();
    5151      //
     
    7272      this.cancelButton.UseVisualStyleBackColor = true;
    7373      //
    74       // entitySelector
     74      // networkItemSelector
    7575      //
    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)
    7777            | System.Windows.Forms.AnchorStyles.Left)
    7878            | 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);
    8585      //
    86       // EntitySelectorDialog
     86      // NetworkItemSelectorDialog
    8787      //
    8888      this.AcceptButton = this.okButton;
     
    9191      this.CancelButton = this.cancelButton;
    9292      this.ClientSize = new System.Drawing.Size(488, 444);
    93       this.Controls.Add(this.entitySelector);
     93      this.Controls.Add(this.networkItemSelector);
    9494      this.Controls.Add(this.cancelButton);
    9595      this.Controls.Add(this.okButton);
    9696      this.MaximizeBox = false;
    9797      this.MinimizeBox = false;
    98       this.Name = "EntitySelectorDialog";
     98      this.Name = "NetworkItemSelectorDialog";
    9999      this.ShowIcon = false;
    100100      this.ShowInTaskbar = false;
    101101      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);
    105105      this.ResumeLayout(false);
    106106
     
    111111    protected System.Windows.Forms.Button okButton;
    112112    protected System.Windows.Forms.Button cancelButton;
    113     protected EntitySelector entitySelector;
     113    protected NetworkItemSelector networkItemSelector;
    114114
    115115  }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/NetworkItemSelectorDialog.cs

    r11527 r11528  
    2424
    2525namespace HeuristicLab.Core.Networks.Views {
    26   public partial class EntitySelectorDialog : Form {
     26  public partial class NetworkItemSelectorDialog : Form {
    2727    public string Caption {
    2828      get { return Text; }
     
    3434      }
    3535    }
    36     public EntitySelector EntitySelector {
    37       get { return entitySelector; }
     36    public NetworkItemSelector NetworkItemSelector {
     37      get { return networkItemSelector; }
    3838    }
    3939
    40     public EntitySelectorDialog() {
     40    public NetworkItemSelectorDialog() {
    4141      InitializeComponent();
    42       okButton.Enabled = entitySelector.SelectedEntity != null;
     42      okButton.Enabled = networkItemSelector.SelectedNetworkItem != null;
    4343    }
    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);
    4646    }
    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;
    4949    }
    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;
    5252    }
    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) {
    5555        DialogResult = DialogResult.OK;
    5656        Close();
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/NetworkItemView.Designer.cs

    r11527 r11528  
    2121
    2222namespace HeuristicLab.Core.Networks.Views {
    23   partial class EntityView {
     23  partial class NetworkItemView {
    2424    /// <summary>
    2525    /// Required designer variable.
     
    5959      this.infoLabel.Location = new System.Drawing.Point(626, 3);
    6060      //
    61       // EntityView
     61      // NetworkItemView
    6262      //
    6363      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    64       this.Name = "EntityView";
     64      this.Name = "NetworkItemView";
    6565      this.Size = new System.Drawing.Size(645, 517);
    6666      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/NetworkItemView.cs

    r11527 r11528  
    2626
    2727namespace HeuristicLab.Core.Networks.Views {
    28   [View("Entity View")]
    29   [Content(typeof(Entity), true)]
    30   [Content(typeof(IEntity), false)]
    31   public partial class EntityView : NamedItemView {
    32     public new IEntity Content {
    33       get { return (IEntity)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; }
    3434      set { base.Content = value; }
    3535    }
    3636
    37     public EntityView() {
     37    public NetworkItemView() {
    3838      InitializeComponent();
    3939    }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/NetworkView.cs

    r11526 r11528  
    2727  [Content(typeof(Network), true)]
    2828  [Content(typeof(INetwork), false)]
    29   public partial class NetworkView : EntityView {
     29  public partial class NetworkView : NetworkItemView {
    3030    public new INetwork Content {
    3131      get { return (INetwork)base.Content; }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/NodeView.cs

    r11526 r11528  
    2727  [Content(typeof(Node), true)]
    2828  [Content(typeof(INode), false)]
    29   public partial class NodeView : EntityView {
     29  public partial class NodeView : NetworkItemView {
    3030    public new INode Content {
    3131      get { return (INode)base.Content; }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/PortParameterView.cs

    r11526 r11528  
    3232  [Content(typeof(IPortParameter<>), false)]
    3333  [Content(typeof(IPortParameter), false)]
    34   public partial class PortParameterView : EntityView {
     34  public partial class PortParameterView : NetworkItemView {
    3535    protected TypeSelectorDialog typeSelectorDialog;
    3636
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/PortView.cs

    r11526 r11528  
    2727  [Content(typeof(Port), true)]
    2828  [Content(typeof(IPort), false)]
    29   public partial class PortView : EntityView {
     29  public partial class PortView : NetworkItemView {
    3030    public new IPort Content {
    3131      get { return (IPort)base.Content; }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/HeuristicLab.Optimization.Networks.Views-3.3.csproj

    r11526 r11528  
    9191  </ItemGroup>
    9292  <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>
    11193    <Compile Include="Core.Networks.Views\GenericNodeView.cs">
    11294      <SubType>UserControl</SubType>
     
    144126    <Compile Include="Core.Networks.Views\MessageView.Designer.cs">
    145127      <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>
    146146    </Compile>
    147147    <Compile Include="Core.Networks.Views\NetworkView.cs">
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Optimization.Networks.Views/AlgorithmNodeView.cs

    r11526 r11528  
    3131  [Content(typeof(AlgorithmNode), true)]
    3232  [Content(typeof(IAlgorithmNode), false)]
    33   public partial class AlgorithmNodeView : EntityView {
     33  public partial class AlgorithmNodeView : NetworkItemView {
    3434    protected TypeSelectorDialog typeSelectorDialog;
    3535
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/ClassDiagram.cd

    r11527 r11528  
    11<?xml version="1.0" encoding="utf-8"?>
    22<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>
    113  <Class Name="HeuristicLab.Core.Networks.GenericNode" Collapsed="true">
    124    <Position X="1" Y="3.5" Width="1.5" />
     
    6355    <Lollipop Position="0.2" />
    6456  </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>
    6565  <Class Name="HeuristicLab.Core.Networks.Node" Collapsed="true">
    6666    <Position X="4.5" Y="2" Width="1.5" />
     
    170170  </Class>
    171171  <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" />
    173173    <TypeIdentifier>
    174174      <HashCode>AAAAAAAAAAAAAAQAAAAAAAAAACAAAAAAAAAAAAAAAAA=</HashCode>
     
    176176    </TypeIdentifier>
    177177  </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>
    185178  <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" />
    187180    <TypeIdentifier>
    188181      <HashCode>AAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
     
    191184  </Interface>
    192185  <Interface Name="HeuristicLab.Core.Networks.IGenericPort" Collapsed="true">
    193     <Position X="13.5" Y="11.75" Width="1.5" />
     186    <Position X="11.25" Y="11.75" Width="1.5" />
    194187    <TypeIdentifier>
    195188      <HashCode>ARAAMAAAQAAAACABACAAAAAAAgQAAAAAAAAACQAAAAQ=</HashCode>
     
    219212  </Interface>
    220213  <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" />
    222215    <TypeIdentifier>
    223216      <HashCode>AAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
     
    225218    </TypeIdentifier>
    226219  </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>
    227227  <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" />
    229229    <TypeIdentifier>
    230230      <HashCode>AAAAAAAAAAAAAAAABAAAQAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
     
    233233  </Interface>
    234234  <Interface Name="HeuristicLab.Core.Networks.IParameterizedPort" Collapsed="true">
    235     <Position X="12.25" Y="10.5" Width="1.5" />
     235    <Position X="10" Y="10.5" Width="1.5" />
    236236    <TypeIdentifier>
    237237      <HashCode>AAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAA=</HashCode>
     
    240240  </Interface>
    241241  <Interface Name="HeuristicLab.Core.Networks.IPort" Collapsed="true">
    242     <Position X="12.25" Y="9" Width="1.5" />
     242    <Position X="10" Y="9" Width="1.5" />
    243243    <TypeIdentifier>
    244244      <HashCode>AAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
     
    247247  </Interface>
    248248  <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" />
    250250    <TypeIdentifier>
    251251      <HashCode>AAAAAAAAAAIAQAAAAAAAQAAAAADAAAAAEQAAAAAAAAA=</HashCode>
     
    254254  </Interface>
    255255  <Interface Name="HeuristicLab.Core.Networks.IPortParameter&lt;T&gt;" Collapsed="true">
    256     <Position X="1" Y="10.5" Width="1.5" />
     256    <Position X="14.5" Y="10.5" Width="1.5" />
    257257    <TypeIdentifier>
    258258      <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAAAAAAAA=</HashCode>
     
    268268  </Interface>
    269269  <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" />
    271271    <TypeIdentifier>
    272272      <HashCode>AAAAAAAAAAAAEAAABAAAQAAAAAAAAAAAAAAAAAQAAAA=</HashCode>
     
    275275  </Interface>
    276276  <Interface Name="HeuristicLab.Optimization.Networks.IConfigurationPort" Collapsed="true">
    277     <Position X="12.25" Y="13.25" Width="1.5" />
     277    <Position X="10" Y="13.25" Width="1.5" />
    278278    <TypeIdentifier>
    279279      <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
     
    282282  </Interface>
    283283  <Interface Name="HeuristicLab.Optimization.Networks.IExecutionPort" Collapsed="true">
    284     <Position X="14.5" Y="13.25" Width="1.5" />
     284    <Position X="12.25" Y="13.25" Width="1.5" />
    285285    <TypeIdentifier>
    286286      <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/GenericPort.cs

    r11526 r11528  
    161161      // collect output parameters from local port
    162162      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())
    166166      );
    167167
     
    169169      if (ConnectedPort != null) {
    170170        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())
    174174        );
    175175      }
     
    178178      if (ConnectedPort != null) {
    179179        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())
    183183        );
    184184      }
     
    186186      // collect remaining input parameters from local port
    187187      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())
    191191      );
    192192
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/INetworkItem.cs

    r11527 r11528  
    2424
    2525namespace HeuristicLab.Core.Networks {
    26   public interface IEntity : INamedItem {
    27     IEntity Parent { get; }
    28     IEnumerable<IEntity> Children { get; }
     26  public interface INetworkItem : INamedItem {
     27    INetworkItem Parent { get; }
     28    IEnumerable<INetworkItem> Children { get; }
    2929    string Path { get; }
    3030    event EventHandler PathChanged;
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/INode.cs

    r11526 r11528  
    2121
    2222namespace HeuristicLab.Core.Networks {
    23   public interface INode : IEntity {
     23  public interface INode : INetworkItem {
    2424    new INetwork Parent { get; set; }
    2525    IKeyedItemCollection<string, IPort> Ports { get; }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/IPort.cs

    r11526 r11528  
    2121
    2222namespace HeuristicLab.Core.Networks {
    23   public interface IPort : IEntity {
     23  public interface IPort : INetworkItem {
    2424    new INode Parent { get; set; }
    2525  }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/IPortParameter.cs

    r11526 r11528  
    2323
    2424namespace HeuristicLab.Core.Networks {
    25   public interface IPortParameter : IEntity {
     25  public interface IPortParameter : INetworkItem {
    2626    new IPort Parent { get; set; }
    2727    Type DataType { get; }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/Network.cs

    r11526 r11528  
    3737    }
    3838
    39     public override IEnumerable<IEntity> Children {
    40       get { return base.Children.Concat(Nodes.AsEnumerable<IEntity>()); }
     39    public override IEnumerable<INetworkItem> Children {
     40      get { return base.Children.Concat(Nodes.AsEnumerable<INetworkItem>()); }
    4141    }
    4242
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/NetworkItem.cs

    r11527 r11528  
    2828
    2929namespace HeuristicLab.Core.Networks {
    30   [Item("Entity", "Abstract base class for entities of an optimization network.")]
     30  [Item("NetworkItem", "Abstract base class for items of a network.")]
    3131  [StorableClass]
    32   public abstract class Entity : NamedItem, IEntity {
     32  public abstract class NetworkItem : NamedItem, INetworkItem {
    3333    public static readonly string PathSeparator = " => ";
    3434    public static new Image StaticItemImage {
     
    3636    }
    3737
    38     private IEntity parent;
    39     public IEntity Parent {
     38    private INetworkItem parent;
     39    public INetworkItem Parent {
    4040      get { return parent; }
    4141      protected set {
     
    4848      }
    4949    }
    50     public virtual IEnumerable<IEntity> Children {
    51       get { return Enumerable.Empty<IEntity>(); }
     50    public virtual IEnumerable<INetworkItem> Children {
     51      get { return Enumerable.Empty<INetworkItem>(); }
    5252    }
    5353    public string Path {
     
    5858
    5959    [StorableConstructor]
    60     protected Entity(bool deserializing) : base(deserializing) { }
    61     protected Entity(Entity original, 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) { }
    6565
    6666    protected override void OnNameChanging(CancelEventArgs<string> e) {
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/Node.cs

    r11526 r11528  
    2929  [Item("Node", "A node of an optimization network.")]
    3030  [StorableClass]
    31   public class Node : Entity, INode {
     31  public class Node : NetworkItem, INode {
    3232    public static new Image StaticItemImage {
    3333      get { return HeuristicLab.Common.Resources.VSImageLibrary.RadialChart; }
     
    4141      }
    4242    }
    43     public override IEnumerable<IEntity> Children {
    44       get { return base.Children.Concat(Ports.AsEnumerable<IEntity>()); }
     43    public override IEnumerable<INetworkItem> Children {
     44      get { return base.Children.Concat(Ports.AsEnumerable<INetworkItem>()); }
    4545    }
    4646
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ParameterizedPort.cs

    r11526 r11528  
    3030  [StorableClass]
    3131  public abstract class ParameterizedPort : Port, IParameterizedPort {
    32     public override IEnumerable<IEntity> Children {
    33       get { return base.Children.Concat(Parameters.AsEnumerable<IEntity>()); }
     32    public override IEnumerable<INetworkItem> Children {
     33      get { return base.Children.Concat(Parameters.AsEnumerable<INetworkItem>()); }
    3434    }
    3535
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/Port.cs

    r11526 r11528  
    2727  [Item("Port", "Abstract base class for ports of an optimization network node.")]
    2828  [StorableClass]
    29   public abstract class Port : Entity, IPort {
     29  public abstract class Port : NetworkItem, IPort {
    3030    public static new Image StaticItemImage {
    3131      get { return HeuristicLab.Common.Resources.VSImageLibrary.Field; }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/PortParameter.cs

    r11526 r11528  
    2828  [Item("PortParameter", "A parameter of a port.")]
    2929  [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 {
    3131    public static new Image StaticItemImage {
    3232      get { return HeuristicLab.Common.Resources.VSImageLibrary.Field; }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/HeuristicLab.Optimization.Networks-3.3.csproj

    r11526 r11528  
    9090  </ItemGroup>
    9191  <ItemGroup>
    92     <Compile Include="Core.Networks\Entity.cs" />
    9392    <Compile Include="Core.Networks\GenericNode.cs" />
    9493    <Compile Include="Core.Networks\GenericPort.cs" />
    9594    <Compile Include="Core.Networks\IConnectedPort.cs" />
    96     <Compile Include="Core.Networks\IEntity.cs" />
    9795    <Compile Include="Core.Networks\IGenericNode.cs" />
    9896    <Compile Include="Core.Networks\IGenericPort.cs" />
     
    10098    <Compile Include="Core.Networks\IMessageValue.cs" />
    10199    <Compile Include="Core.Networks\INetwork.cs" />
     100    <Compile Include="Core.Networks\INetworkItem.cs" />
    102101    <Compile Include="Core.Networks\INode.cs" />
    103102    <Compile Include="Core.Networks\IParameterizedPort.cs" />
     
    109108    <Compile Include="Core.Networks\MessageValueCollection.cs" />
    110109    <Compile Include="Core.Networks\Network.cs" />
     110    <Compile Include="Core.Networks\NetworkItem.cs" />
    111111    <Compile Include="Core.Networks\Node.cs" />
    112112    <Compile Include="Core.Networks\NodeCollection.cs" />
Note: See TracChangeset for help on using the changeset viewer.