Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/14/11 16:49:58 (13 years ago)
Author:
ascheibe
Message:

#1233 worked on Administration UI

Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/Administration
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/Administration/ResourcesView.Designer.cs

    r5638 r5676  
    4949      this.imageListSlaveGroups = new System.Windows.Forms.ImageList(this.components);
    5050      this.splitSlaves = new System.Windows.Forms.SplitContainer();
    51       this.updateSlaveGroups = new HeuristicLab.Clients.Hive.Views.Common.UpdateControl();
     51      this.btnSave = new System.Windows.Forms.Button();
    5252      this.btnRemoveGroup = new System.Windows.Forms.Button();
    5353      this.btnAddGroup = new System.Windows.Forms.Button();
     
    5555      this.tabSlaveGroup = new System.Windows.Forms.TabControl();
    5656      this.tabDetails = new System.Windows.Forms.TabPage();
     57      this.tabSchedule = new System.Windows.Forms.TabPage();
     58      this.tabJobs = new System.Windows.Forms.TabPage();
     59      this.updateSlaveGroup = new HeuristicLab.Clients.Hive.Views.Common.UpdateControl();
    5760      this.slaveView = new HeuristicLab.Clients.Hive.Views.Administration.SlaveView();
    58       this.tabSchedule = new System.Windows.Forms.TabPage();
    5961      this.updateScheduleControl = new HeuristicLab.Clients.Hive.Views.Common.UpdateControl();
    6062      this.scheduleView = new HeuristicLab.Clients.Hive.Views.Administration.ScheduleView();
    61       this.tabJobs = new System.Windows.Forms.TabPage();
    62       this.updateControl1 = new HeuristicLab.Clients.Hive.Views.Common.UpdateControl();
     63      this.updateJobs = new HeuristicLab.Clients.Hive.Views.Common.UpdateControl();
    6364      this.hiveJobListViewSlaves = new HeuristicLab.Clients.Hive.Views.HiveJobListView();
    6465      ((System.ComponentModel.ISupportInitialize)(this.splitSlaves)).BeginInit();
     
    8889      // splitSlaves.Panel1
    8990      //
    90       this.splitSlaves.Panel1.Controls.Add(this.updateSlaveGroups);
     91      this.splitSlaves.Panel1.Controls.Add(this.updateSlaveGroup);
     92      this.splitSlaves.Panel1.Controls.Add(this.btnSave);
    9193      this.splitSlaves.Panel1.Controls.Add(this.btnRemoveGroup);
    9294      this.splitSlaves.Panel1.Controls.Add(this.btnAddGroup);
     
    100102      this.splitSlaves.TabIndex = 3;
    101103      //
    102       // updateSlaveGroups
    103       //
    104       this.updateSlaveGroups.Location = new System.Drawing.Point(63, 3);
    105       this.updateSlaveGroups.Name = "updateSlaveGroups";
    106       this.updateSlaveGroups.Size = new System.Drawing.Size(75, 24);
    107       this.updateSlaveGroups.TabIndex = 4;
    108       this.updateSlaveGroups.UpdateAction = null;
     104      // btnSave
     105      //
     106      this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image")));
     107      this.btnSave.Location = new System.Drawing.Point(63, 3);
     108      this.btnSave.Name = "btnSave";
     109      this.btnSave.Size = new System.Drawing.Size(24, 24);
     110      this.btnSave.TabIndex = 5;
     111      this.btnSave.UseVisualStyleBackColor = true;
     112      this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
    109113      //
    110114      // btnRemoveGroup
     
    116120      this.btnRemoveGroup.TabIndex = 2;
    117121      this.btnRemoveGroup.UseVisualStyleBackColor = true;
     122      this.btnRemoveGroup.Click += new System.EventHandler(this.btnRemoveGroup_Click);
    118123      //
    119124      // btnAddGroup
     
    125130      this.btnAddGroup.TabIndex = 1;
    126131      this.btnAddGroup.UseVisualStyleBackColor = true;
     132      this.btnAddGroup.Click += new System.EventHandler(this.btnAddGroup_Click);
    127133      //
    128134      // treeSlaveGroup
    129135      //
     136      this.treeSlaveGroup.AllowDrop = true;
    130137      this.treeSlaveGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    131138                  | System.Windows.Forms.AnchorStyles.Left)
     
    138145      this.treeSlaveGroup.Size = new System.Drawing.Size(243, 511);
    139146      this.treeSlaveGroup.TabIndex = 0;
     147      this.treeSlaveGroup.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.treeSlaveGroup_ItemDrag);
    140148      this.treeSlaveGroup.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeSlaveGroup_NodeMouseClick);
     149      this.treeSlaveGroup.DragDrop += new System.Windows.Forms.DragEventHandler(this.treeSlaveGroup_DragDrop);
     150      this.treeSlaveGroup.DragEnter += new System.Windows.Forms.DragEventHandler(this.treeSlaveGroup_DragEnter);
     151      this.treeSlaveGroup.DragOver += new System.Windows.Forms.DragEventHandler(this.treeSlaveGroup_DragOver);
     152      this.treeSlaveGroup.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.treeSlaveGroup_QueryContinueDrag);
    141153      //
    142154      // tabSlaveGroup
     
    164176      this.tabDetails.Text = "Details";
    165177      this.tabDetails.UseVisualStyleBackColor = true;
    166       //
    167       // slaveView
    168       //
    169       this.slaveView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    170                   | System.Windows.Forms.AnchorStyles.Right)));
    171       this.slaveView.Caption = "SlaveView";
    172       this.slaveView.Content = null;
    173       this.slaveView.Location = new System.Drawing.Point(7, 7);
    174       this.slaveView.Name = "slaveView";
    175       this.slaveView.ReadOnly = false;
    176       this.slaveView.Size = new System.Drawing.Size(564, 210);
    177       this.slaveView.TabIndex = 0;
    178178      //
    179179      // tabSchedule
     
    189189      this.tabSchedule.UseVisualStyleBackColor = true;
    190190      //
     191      // tabJobs
     192      //
     193      this.tabJobs.Controls.Add(this.updateJobs);
     194      this.tabJobs.Controls.Add(this.hiveJobListViewSlaves);
     195      this.tabJobs.Location = new System.Drawing.Point(4, 22);
     196      this.tabJobs.Name = "tabJobs";
     197      this.tabJobs.Padding = new System.Windows.Forms.Padding(3);
     198      this.tabJobs.Size = new System.Drawing.Size(577, 515);
     199      this.tabJobs.TabIndex = 2;
     200      this.tabJobs.Text = "Jobs";
     201      this.tabJobs.UseVisualStyleBackColor = true;
     202      //
     203      // updateSlaveGroup
     204      //
     205      this.updateSlaveGroup.Location = new System.Drawing.Point(94, 3);
     206      this.updateSlaveGroup.Name = "updateSlaveGroup";
     207      this.updateSlaveGroup.Size = new System.Drawing.Size(75, 24);
     208      this.updateSlaveGroup.TabIndex = 6;
     209      this.updateSlaveGroup.UpdateAction = null;
     210      //
     211      // slaveView
     212      //
     213      this.slaveView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     214                  | System.Windows.Forms.AnchorStyles.Right)));
     215      this.slaveView.Caption = "SlaveView";
     216      this.slaveView.Content = null;
     217      this.slaveView.Location = new System.Drawing.Point(7, 7);
     218      this.slaveView.Name = "slaveView";
     219      this.slaveView.ReadOnly = false;
     220      this.slaveView.Size = new System.Drawing.Size(564, 210);
     221      this.slaveView.TabIndex = 0;
     222      //
    191223      // updateScheduleControl
    192224      //
     
    211243      this.scheduleView.TabIndex = 0;
    212244      //
    213       // tabJobs
    214       //
    215       this.tabJobs.Controls.Add(this.updateControl1);
    216       this.tabJobs.Controls.Add(this.hiveJobListViewSlaves);
    217       this.tabJobs.Location = new System.Drawing.Point(4, 22);
    218       this.tabJobs.Name = "tabJobs";
    219       this.tabJobs.Padding = new System.Windows.Forms.Padding(3);
    220       this.tabJobs.Size = new System.Drawing.Size(577, 515);
    221       this.tabJobs.TabIndex = 2;
    222       this.tabJobs.Text = "Jobs";
    223       this.tabJobs.UseVisualStyleBackColor = true;
    224       //
    225       // updateControl1
    226       //
    227       this.updateControl1.Location = new System.Drawing.Point(7, 3);
    228       this.updateControl1.Name = "updateControl1";
    229       this.updateControl1.Size = new System.Drawing.Size(75, 24);
    230       this.updateControl1.TabIndex = 1;
    231       this.updateControl1.UpdateAction = null;
     245      // updateJobs
     246      //
     247      this.updateJobs.Location = new System.Drawing.Point(7, 3);
     248      this.updateJobs.Name = "updateJobs";
     249      this.updateJobs.Size = new System.Drawing.Size(75, 24);
     250      this.updateJobs.TabIndex = 1;
     251      this.updateJobs.UpdateAction = null;
    232252      //
    233253      // hiveJobListViewSlaves
     
    266286
    267287    private System.Windows.Forms.SplitContainer splitSlaves;
    268     private Common.UpdateControl updateSlaveGroups;
    269288    private System.Windows.Forms.Button btnRemoveGroup;
    270289    private System.Windows.Forms.Button btnAddGroup;
     
    274293    private System.Windows.Forms.TabPage tabSchedule;
    275294    private System.Windows.Forms.TabPage tabJobs;
    276     private Common.UpdateControl updateControl1;
     295    private Common.UpdateControl updateJobs;
    277296    private HiveJobListView hiveJobListViewSlaves;
    278297    private SlaveView slaveView;
     
    280299    private ScheduleView scheduleView;
    281300    private Common.UpdateControl updateScheduleControl;
     301    private System.Windows.Forms.Button btnSave;
     302    private Common.UpdateControl updateSlaveGroup;
    282303  }
    283304}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/Administration/ResourcesView.cs

    r5638 r5676  
    2121
    2222using System;
     23using System.Drawing;
    2324using System.Linq;
    2425using System.Windows.Forms;
     
    4142      treeSlaveGroup.ImageList.Images.Add(HiveImageLibrary.SlaveGroup);
    4243      updateScheduleControl.UpdateAction = new Action(UpdateSchedule);
    43     }
    44 
    45     private void UpdateSchedule() {
    46       Guid resourceId = scheduleView.ResourceId;
    47       if (resourceId != null) {
    48         ServiceLocator.Instance.CallHiveService(service => {
    49           var appointments = service.GetScheduleForResource(resourceId);
    50           ItemList<Appointment> ias = new ItemList<Appointment>();
    51           appointments.ForEach(a => ias.Add(a));
    52           scheduleView.Invoke(new Action(() => scheduleView.Content = ias));
    53         });
    54       }
     44      updateSlaveGroup.UpdateAction = new Action(UpdateSlaveGroups);
    5545    }
    5646
    5747    #region Register Content Events
    5848    protected override void DeregisterContentEvents() {
    59       // TODO: Deregister your event handlers on the Content here
     49      Content.ItemsAdded -= new Collections.CollectionItemsChangedEventHandler<Collections.IndexedItem<Resource>>(Content_ItemsAdded);
     50      Content.ItemsRemoved -= new Collections.CollectionItemsChangedEventHandler<Collections.IndexedItem<Resource>>(Content_ItemsRemoved);
    6051      base.DeregisterContentEvents();
    6152    }
    6253    protected override void RegisterContentEvents() {
    6354      base.RegisterContentEvents();
    64       // TODO: Register your event handlers on the Content here
     55      Content.ItemsAdded += new Collections.CollectionItemsChangedEventHandler<Collections.IndexedItem<Resource>>(Content_ItemsAdded);
     56      Content.ItemsRemoved += new Collections.CollectionItemsChangedEventHandler<Collections.IndexedItem<Resource>>(Content_ItemsRemoved);
    6557    }
    6658    #endregion
     
    7264        treeSlaveGroup.Nodes.Clear();
    7365      } else {
    74 
     66        treeSlaveGroup.Nodes.Clear();
     67
     68        //rebuild
    7569        TreeNode ungrp = new TreeNode("UNGROUPED");
    7670        ungrp.ImageIndex = treeSlaveGroup.ImageList.Images.Count - 1;
     
    9993            treeSlaveGroup.Nodes.Add(tn);
    10094
    101 
    10295          } else if (g.GetType() == typeof(Slave)) {
    10396            if (g.ParentResourceId == null) {
     
    120113
    121114    private void treeSlaveGroup_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) {
     115      if (slaveView.Content != null && slaveView.Content is SlaveGroup) {
     116        slaveView.Content.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged);
     117      }
     118
     119      slaveView.Content = (Resource)e.Node.Tag;
     120
    122121      if (e.Node.Tag.GetType() == typeof(Slave)) {
    123         slaveView.Content = (Slave)e.Node.Tag;
    124122        scheduleView.ResourceId = ((Slave)e.Node.Tag).Id;
    125       }
    126     }
    127 
    128     #region Event Handlers
    129     // TODO: Put event handlers here
    130     #endregion
     123      } else if (e.Node.Tag is SlaveGroup) {
     124        slaveView.Content.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged);
     125      }
     126    }
     127
     128    void SlaveViewContent_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) {
     129      OnContentChanged();
     130    }
     131
     132    private void btnAddGroup_Click(object sender, EventArgs e) {
     133      SlaveGroup newGroup = new SlaveGroup();
     134      newGroup.Name = "New Group";
     135      Content.Add(newGroup);
     136    }
     137
     138    void Content_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<Collections.IndexedItem<Resource>> e) {
     139      OnContentChanged();
     140    }
     141
     142    void Content_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<Collections.IndexedItem<Resource>> e) {
     143      OnContentChanged();
     144    }
     145
     146    private void btnRemoveGroup_Click(object sender, EventArgs e) {
     147      if (treeSlaveGroup.SelectedNode != null && treeSlaveGroup.SelectedNode.Tag != null) {
     148        Content.Remove((Resource)treeSlaveGroup.SelectedNode.Tag);
     149      }
     150    }
     151
     152    private void btnSave_Click(object sender, EventArgs e) {
     153      foreach (Resource res in Content) {
     154        if (res is SlaveGroup && res.Id == Guid.Empty) {
     155          SlaveGroup slaveGroup = (SlaveGroup)res;
     156          ServiceLocator.Instance.CallHiveService(service => service.AddSlaveGroup(slaveGroup));
     157        }
     158        if (res.Id != Guid.Empty && res.Modified) {
     159          if (res is SlaveGroup) {
     160            ServiceLocator.Instance.CallHiveService(service => service.UpdateSlaveGroup((SlaveGroup)res));
     161          } else if (res is Slave) {
     162            ServiceLocator.Instance.CallHiveService(service => service.UpdateSlave((Slave)res));
     163          }
     164        }
     165      }
     166    }
     167
     168    private void treeSlaveGroup_DragDrop(object sender, DragEventArgs e) {
     169      if (e.Data.GetDataPresent("System.Windows.Forms.TreeNode", false)) {
     170        Point pt = ((TreeView)sender).PointToClient(new Point(e.X, e.Y));
     171        TreeNode destNode = ((TreeView)sender).GetNodeAt(pt);
     172        TreeNode newNode = (TreeNode)e.Data.GetData("System.Windows.Forms.TreeNode");
     173
     174        if (destNode.TreeView == newNode.TreeView) {
     175          SlaveGroup sgrp = null;
     176          if (destNode.Tag != null && destNode.Tag is SlaveGroup) {
     177            sgrp = (SlaveGroup)destNode.Tag;
     178          }
     179          if (destNode.Parent != null && destNode.Parent.Tag is SlaveGroup) {
     180            sgrp = (SlaveGroup)destNode.Parent.Tag;
     181          }
     182
     183          if (sgrp != null) {
     184            if (newNode.Tag != null && newNode.Tag is Slave) {
     185              Slave slave = (Slave)newNode.Tag;
     186              if (slave.ParentResourceId != sgrp.Id) {
     187                slave.ParentResourceId = sgrp.Id;
     188                OnContentChanged();
     189              }
     190            }
     191          }
     192        }
     193      }
     194    }
     195
     196    private void treeSlaveGroup_ItemDrag(object sender, ItemDragEventArgs e) {
     197      TreeNode sourceNode = (TreeNode)e.Item;
     198      DoDragDrop(sourceNode, DragDropEffects.All);
     199    }
     200
     201    private void treeSlaveGroup_DragEnter(object sender, DragEventArgs e) {
     202      e.Effect = DragDropEffects.Move;
     203    }
     204
     205    private void treeSlaveGroup_DragOver(object sender, DragEventArgs e) {
     206      e.Effect = DragDropEffects.Move;
     207    }
     208
     209    private void treeSlaveGroup_QueryContinueDrag(object sender, QueryContinueDragEventArgs e) {
     210      e.Action = DragAction.Continue;
     211    }
     212
     213    void ResetView() {
     214      treeSlaveGroup.Nodes.Clear();
     215      if (slaveView.Content != null && slaveView.Content is SlaveGroup) {
     216        slaveView.Content.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged);
     217      }
     218      slaveView.Content = null;
     219      scheduleView.ResourceId = Guid.Empty;
     220    }
     221
     222    private void UpdateSlaveGroups() {
     223      this.Invoke(new Action(ResetView));
     224      Content.Clear();
     225      IItemList<Resource> resources = new ItemList<Resource>();
     226
     227      ServiceLocator.Instance.CallHiveService(service => {
     228        service.GetSlaveGroups().ForEach(g => resources.Add(g));
     229        service.GetSlaves().ForEach(s => resources.Add(s));
     230      });
     231      Content = resources;
     232    }
     233
     234    private void UpdateSchedule() {
     235      Guid resourceId = scheduleView.ResourceId;
     236      if (resourceId != null) {
     237        ServiceLocator.Instance.CallHiveService(service => {
     238          var appointments = service.GetScheduleForResource(resourceId);
     239          ItemList<Appointment> ias = new ItemList<Appointment>();
     240          appointments.ForEach(a => ias.Add(a));
     241          scheduleView.Invoke(new Action(() => scheduleView.Content = ias));
     242        });
     243      }
     244    }
    131245  }
    132246}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/Administration/ResourcesView.resx

    r5638 r5676  
    122122  </metadata>
    123123  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
     124  <data name="btnSave.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     125    <value>
     126        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACH
     127        DwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKOWlDQ1BQaG90b3Nob3AgSUNDIHByb2Zp
     128        bGUAAEjHnZZ3VFTXFofPvXd6oc0wAlKG3rvAANJ7k15FYZgZYCgDDjM0sSGiAhFFRJoiSFDEgNFQJFZE
     129        sRAUVLAHJAgoMRhFVCxvRtaLrqy89/Ly++Osb+2z97n77L3PWhcAkqcvl5cGSwGQyhPwgzyc6RGRUXTs
     130        AIABHmCAKQBMVka6X7B7CBDJy82FniFyAl8EAfB6WLwCcNPQM4BOB/+fpFnpfIHomAARm7M5GSwRF4g4
     131        JUuQLrbPipgalyxmGCVmvihBEcuJOWGRDT77LLKjmNmpPLaIxTmns1PZYu4V8bZMIUfEiK+ICzO5nCwR
     132        3xKxRoowlSviN+LYVA4zAwAUSWwXcFiJIjYRMYkfEuQi4uUA4EgJX3HcVyzgZAvEl3JJS8/hcxMSBXQd
     133        li7d1NqaQffkZKVwBALDACYrmcln013SUtOZvBwAFu/8WTLi2tJFRbY0tba0NDQzMv2qUP91829K3NtF
     134        ehn4uWcQrf+L7a/80hoAYMyJarPziy2uCoDOLQDI3fti0zgAgKSobx3Xv7oPTTwviQJBuo2xcVZWlhGX
     135        wzISF/QP/U+Hv6GvvmckPu6P8tBdOfFMYYqALq4bKy0lTcinZ6QzWRy64Z+H+B8H/nUeBkGceA6fwxNF
     136        hImmjMtLELWbx+YKuGk8Opf3n5r4D8P+pMW5FonS+BFQY4yA1HUqQH7tBygKESDR+8Vd/6NvvvgwIH55
     137        4SqTi3P/7zf9Z8Gl4iWDm/A5ziUohM4S8jMX98TPEqABAUgCKpAHykAd6ABDYAasgC1wBG7AG/iDEBAJ
     138        VgMWSASpgA+yQB7YBApBMdgJ9oBqUAcaQTNoBcdBJzgFzoNL4Bq4AW6D+2AUTIBnYBa8BgsQBGEhMkSB
     139        5CEVSBPSh8wgBmQPuUG+UBAUCcVCCRAPEkJ50GaoGCqDqqF6qBn6HjoJnYeuQIPQXWgMmoZ+h97BCEyC
     140        qbASrAUbwwzYCfaBQ+BVcAK8Bs6FC+AdcCXcAB+FO+Dz8DX4NjwKP4PnEIAQERqiihgiDMQF8UeikHiE
     141        j6xHipAKpAFpRbqRPuQmMorMIG9RGBQFRUcZomxRnqhQFAu1BrUeVYKqRh1GdaB6UTdRY6hZ1Ec0Ga2I
     142        1kfboL3QEegEdBa6EF2BbkK3oy+ib6Mn0K8xGAwNo42xwnhiIjFJmLWYEsw+TBvmHGYQM46Zw2Kx8lh9
     143        rB3WH8vECrCF2CrsUexZ7BB2AvsGR8Sp4Mxw7rgoHA+Xj6vAHcGdwQ3hJnELeCm8Jt4G749n43PwpfhG
     144        fDf+On4Cv0CQJmgT7AghhCTCJkIloZVwkfCA8JJIJKoRrYmBRC5xI7GSeIx4mThGfEuSIemRXEjRJCFp
     145        B+kQ6RzpLuklmUzWIjuSo8gC8g5yM/kC+RH5jQRFwkjCS4ItsUGiRqJDYkjiuSReUlPSSXK1ZK5kheQJ
     146        yeuSM1J4KS0pFymm1HqpGqmTUiNSc9IUaVNpf+lU6RLpI9JXpKdksDJaMm4ybJkCmYMyF2TGKQhFneJC
     147        YVE2UxopFykTVAxVm+pFTaIWU7+jDlBnZWVkl8mGyWbL1sielh2lITQtmhcthVZKO04bpr1borTEaQln
     148        yfYlrUuGlszLLZVzlOPIFcm1yd2WeydPl3eTT5bfJd8p/1ABpaCnEKiQpbBf4aLCzFLqUtulrKVFS48v
     149        vacIK+opBimuVTyo2K84p6Ss5KGUrlSldEFpRpmm7KicpFyufEZ5WoWiYq/CVSlXOavylC5Ld6Kn0Cvp
     150        vfRZVUVVT1Whar3qgOqCmrZaqFq+WpvaQ3WCOkM9Xr1cvUd9VkNFw08jT6NF454mXpOhmai5V7NPc15L
     151        Wytca6tWp9aUtpy2l3audov2Ax2yjoPOGp0GnVu6GF2GbrLuPt0berCehV6iXo3edX1Y31Kfq79Pf9AA
     152        bWBtwDNoMBgxJBk6GWYathiOGdGMfI3yjTqNnhtrGEcZ7zLuM/5oYmGSYtJoct9UxtTbNN+02/R3Mz0z
     153        llmN2S1zsrm7+QbzLvMXy/SXcZbtX3bHgmLhZ7HVosfig6WVJd+y1XLaSsMq1qrWaoRBZQQwShiXrdHW
     154        ztYbrE9Zv7WxtBHYHLf5zdbQNtn2iO3Ucu3lnOWNy8ft1OyYdvV2o/Z0+1j7A/ajDqoOTIcGh8eO6o5s
     155        xybHSSddpySno07PnU2c+c7tzvMuNi7rXM65Iq4erkWuA24ybqFu1W6P3NXcE9xb3Gc9LDzWepzzRHv6
     156        eO7yHPFS8mJ5NXvNelt5r/Pu9SH5BPtU+zz21fPl+3b7wX7efrv9HqzQXMFb0ekP/L38d/s/DNAOWBPw
     157        YyAmMCCwJvBJkGlQXlBfMCU4JvhI8OsQ55DSkPuhOqHC0J4wybDosOaw+XDX8LLw0QjjiHUR1yIVIrmR
     158        XVHYqLCopqi5lW4r96yciLaILoweXqW9KnvVldUKq1NWn46RjGHGnIhFx4bHHol9z/RnNjDn4rziauNm
     159        WS6svaxnbEd2OXuaY8cp40zG28WXxU8l2CXsTphOdEisSJzhunCruS+SPJPqkuaT/ZMPJX9KCU9pS8Wl
     160        xqae5Mnwknm9acpp2WmD6frphemja2zW7Fkzy/fhN2VAGasyugRU0c9Uv1BHuEU4lmmfWZP5Jiss60S2
     161        dDYvuz9HL2d7zmSue+63a1FrWWt78lTzNuWNrXNaV78eWh+3vmeD+oaCDRMbPTYe3kTYlLzpp3yT/LL8
     162        V5vDN3cXKBVsLBjf4rGlpVCikF84stV2a9021DbutoHt5turtn8sYhddLTYprih+X8IqufqN6TeV33za
     163        Eb9joNSydP9OzE7ezuFdDrsOl0mX5ZaN7/bb3VFOLy8qf7UnZs+VimUVdXsJe4V7Ryt9K7uqNKp2Vr2v
     164        Tqy+XeNc01arWLu9dn4fe9/Qfsf9rXVKdcV17w5wD9yp96jvaNBqqDiIOZh58EljWGPft4xvm5sUmoqb
     165        PhziHRo9HHS4t9mqufmI4pHSFrhF2DJ9NProje9cv+tqNWytb6O1FR8Dx4THnn4f+/3wcZ/jPScYJ1p/
     166        0Pyhtp3SXtQBdeR0zHYmdo52RXYNnvQ+2dNt293+o9GPh06pnqo5LXu69AzhTMGZT2dzz86dSz83cz7h
     167        /HhPTM/9CxEXbvUG9g5c9Ll4+ZL7pQt9Tn1nL9tdPnXF5srJq4yrndcsr3X0W/S3/2TxU/uA5UDHdavr
     168        XTesb3QPLh88M+QwdP6m681Lt7xuXbu94vbgcOjwnZHokdE77DtTd1PuvriXeW/h/sYH6AdFD6UeVjxS
     169        fNTws+7PbaOWo6fHXMf6Hwc/vj/OGn/2S8Yv7ycKnpCfVEyqTDZPmU2dmnafvvF05dOJZ+nPFmYKf5X+
     170        tfa5zvMffnP8rX82YnbiBf/Fp99LXsq/PPRq2aueuYC5R69TXy/MF72Rf3P4LeNt37vwd5MLWe+x7ys/
     171        6H7o/ujz8cGn1E+f/gUDmPP8usTo0wAAAAlwSFlzAAALDAAACwwBP0AiyAAAAh5JREFUOE+N091PklEc
     172        B3DfbvoHuuyi+S90metF3Mqt0aobs1xOF0EwWW6VvUzF+TYUh+IaT0XimCRpriIf2Zhp4itNS5wCcyRY
     173        4dT5IBS+xL6d5xFQOV50ce7O+ex7vr9z0gCkJdZKYAILThPGB9SwdT1EH6NAzzMp3hmUsFuq4Rxk8N09
     174        RLbvn0kedn8xwWlXwzv9AkFfD8JrA9j5PSys0CqLgOc1vo60gTU/gqO/LYkkAbazHLFtx38t3ZNrNGDt
     175        UCIyJ0M0qMdO2Iq/W8OIbX1GLDqEXe4ton4NuBkpfrA5aK24QgPvDWXgRkUIue4gElDjz6oREZ8K3ORl
     176        rH88gWBXBpY60uFhMtFyX0wDfYxcADZdMgI00YCZBzLgeZ6J5vJLNNBL2uYceSTB0cCKAJAEBGgsy6cB
     177        i04iAFSCKXIF694V/AKQhXrFBRowa0uPAKpJB+J4B+lCAi9JUCvLowGTpoR0wCeQpnSwD/AJeEAlyaUB
     178        o/pWfAo8kJgCnyA+BdKB30gAJguVpedo4FVDETZGzpMSJckEYd9hIDGFp8VnaOBl3Q1wApD6DuJXODCF
     179        x0U5NMDUFOCXPReh2dspDynRwd4Yv7UfQ8XN0zQwzdbAormKwc5CuD49wE+3Dpy3CmujYix2Z2NMexxv
     180        Kk+iRXEKNoOcBvgvujzfj7EPtejVy6FXXUej8iLq7oqgvXcWxioRbEwJvJPmQ9/5H8ts+Q1zr/Q5AAAA
     181        AElFTkSuQmCC
     182</value>
     183  </data>
    124184  <data name="btnRemoveGroup.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    125185    <value>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/Administration/SlaveView.Designer.cs

    r5638 r5676  
    127127      this.txtName.Size = new System.Drawing.Size(249, 20);
    128128      this.txtName.TabIndex = 21;
     129      this.txtName.TextChanged += new System.EventHandler(this.txtName_TextChanged_1);
    129130      //
    130131      // txtCPU
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/Administration/SlaveView.cs

    r5638 r5676  
    2020#endregion
    2121
     22using System;
    2223using System.Windows.Forms;
    2324using HeuristicLab.Core.Views;
     
    2728namespace HeuristicLab.Clients.Hive.Views.Administration {
    2829  [View("SlaveView")]
    29   [Content(typeof(Slave), IsDefaultView = true)]
     30  [Content(typeof(Resource), IsDefaultView = true)]
    3031  public partial class SlaveView : ItemView {
    31     public new Slave Content {
    32       get { return (Slave)base.Content; }
     32    public new Resource Content {
     33      get { return (Resource)base.Content; }
    3334      set { base.Content = value; }
    3435    }
     
    5051      base.OnContentChanged();
    5152      if (Content == null) {
     53        ShowSlaveUI(true);
    5254        txtName.Clear();
    5355        txtCPU.Clear();
     
    6062        txtId.Clear();
    6163      } else {
    62         txtName.Text = Content.Name;
    63         txtCPU.Text = Content.Cores.ToString() + " Cores @ " + Content.CpuSpeed.ToString() + " Mhz, Arch.: " + Content.CpuArchitecture.ToString();
    64         txtDetailsDescription.Text = Content.Description;
    65         txtMemory.Text = Content.Memory.ToString();
    66         txtOS.Text = Content.OperatingSystem;
    67         txtSlaveState.Text = Content.SlaveState.ToString();
    68         txtLastHeartbeat.Text = Content.LastHeartbeat.ToString();
    69         txtFreeMemory.Text = Content.FreeMemory.ToString();
    70         txtId.Text = Content.Id.ToString();
     64        if (Content.GetType() == typeof(Slave)) {
     65          ShowSlaveUI(true);
     66          Slave ct = (Slave)Content;
     67          txtName.Text = ct.Name;
     68          txtCPU.Text = ct.Cores.ToString() + " Cores @ " + ct.CpuSpeed.ToString() + " Mhz, Arch.: " + ct.CpuArchitecture.ToString();
     69          txtDetailsDescription.Text = ct.Description;
     70          txtMemory.Text = ct.Memory.ToString();
     71          txtOS.Text = ct.OperatingSystem;
     72          txtSlaveState.Text = ct.SlaveState.ToString();
     73          txtLastHeartbeat.Text = ct.LastHeartbeat.ToString();
     74          txtFreeMemory.Text = ct.FreeMemory.ToString();
     75          txtId.Text = ct.Id.ToString();
     76        } else if (Content.GetType() == typeof(SlaveGroup)) {
     77          SlaveGroup ct = (SlaveGroup)Content;
     78          txtName.Text = ct.Name;
     79          ShowSlaveUI(false);
     80        } else
     81          throw new Exception("Unknown Resource in SlaveView");
     82
    7183      }
     84    }
     85
     86    void txtName_TextChanged(object sender, EventArgs e) {
     87      throw new NotImplementedException();
     88    }
     89
     90    private void ShowSlaveUI(bool show) {
     91      label2.Visible = show;
     92      label1.Visible = show;
     93      label10.Visible = show;
     94      label11.Visible = show;
     95      label12.Visible = show;
     96      label13.Visible = show;
     97      label14.Visible = show;
     98      label15.Visible = show;
     99      txtCPU.Visible = show;
     100      txtDetailsDescription.Visible = show;
     101      txtMemory.Visible = show;
     102      txtOS.Visible = show;
     103      txtSlaveState.Visible = show;
     104      txtLastHeartbeat.Visible = show;
     105      txtFreeMemory.Visible = show;
     106      txtId.Visible = show;
    72107    }
    73108
     
    75110      base.SetEnabledStateOfControls();
    76111    }
     112
     113    private void txtName_TextChanged_1(object sender, EventArgs e) {
     114      if (Content != null && Content is SlaveGroup) {
     115        Content.Name = txtName.Text;
     116      }
     117    }
    77118  }
    78119}
Note: See TracChangeset for help on using the changeset viewer.