Free cookie consent management tool by TermsFeed Policy Generator

Changeset 15412


Ignore:
Timestamp:
10/07/17 10:32:07 (7 years ago)
Author:
jkarder
Message:

#2839:

  • worked on resources and projects views
  • changed resource selector to be able to select projects and assigned resources
  • updated service clients
Location:
branches/HiveProjectManagement
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectView.Designer.cs

    r15401 r15412  
    8585      this.ownerComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    8686      this.ownerComboBox.FormattingEnabled = true;
    87       this.ownerComboBox.Location = new System.Drawing.Point(72, 138);
     87      this.ownerComboBox.Location = new System.Drawing.Point(102, 138);
    8888      this.ownerComboBox.Name = "ownerComboBox";
    8989      this.ownerComboBox.Size = new System.Drawing.Size(434, 21);
     
    170170      // refreshButton
    171171      //
    172       this.refreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    173172      this.refreshButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Refresh;
    174       this.refreshButton.Location = new System.Drawing.Point(512, 136);
     173      this.refreshButton.Location = new System.Drawing.Point(72, 136);
    175174      this.refreshButton.Name = "refreshButton";
    176175      this.refreshButton.Size = new System.Drawing.Size(24, 24);
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectView.cs

    r15401 r15412  
    2525using System.Windows.Forms;
    2626using HeuristicLab.Clients.Access;
     27using HeuristicLab.Clients.Hive.Views;
    2728using HeuristicLab.Core.Views;
    2829using HeuristicLab.MainForm;
    29 using Tasks = System.Threading.Tasks;
    3030
    3131namespace HeuristicLab.Clients.Hive.Administrator.Views {
     
    4848    }
    4949
     50    #region Overrides
    5051    protected override void OnClosing(FormClosingEventArgs e) {
    5152      AccessClient.Instance.Refreshed -= AccessClient_Instance_Refreshed;
     
    6263      Content.PropertyChanged -= Content_PropertyChanged;
    6364      base.DeregisterContentEvents();
    64     }
    65 
    66     private void Content_PropertyChanged(object sender, PropertyChangedEventArgs e) {
    67       OnContentChanged();
    6865    }
    6966
     
    7370        nameTextBox.Clear();
    7471        descriptionTextBox.Clear();
    75         ownerComboBox.DataSource = null;
    7672        ownerComboBox.SelectedItem = null;
    7773        createdTextBox.Clear();
     
    8278        nameTextBox.Text = Content.Name;
    8379        descriptionTextBox.Text = Content.Description;
    84         ownerComboBox.DataSource = AccessClient.Instance.UsersAndGroups.OfType<LightweightUser>().ToList();
    8580        ownerComboBox.SelectedItem = AccessClient.Instance.UsersAndGroups.FirstOrDefault(x => x.Id == Content.OwnerUserId);
    8681        createdTextBox.Text = Content.DateCreated.ToString("ddd, dd.MM.yyyy, HH:mm:ss");
     
    9994      nameTextBox.Enabled = enabled;
    10095      descriptionTextBox.Enabled = enabled;
     96      refreshButton.Enabled = enabled;
    10197      ownerComboBox.Enabled = enabled;
    10298      createdTextBox.Enabled = enabled;
     
    104100      endDateTimePicker.Enabled = enabled && Content.EndDate.HasValue;
    105101      indefiniteCheckBox.Enabled = enabled;
     102    }
     103    #endregion
     104
     105    #region Event Handlers
     106    private void Content_PropertyChanged(object sender, PropertyChangedEventArgs e) {
     107      OnContentChanged();
    106108    }
    107109
     
    125127
    126128    private async void ProjectView_Load(object sender, EventArgs e) {
    127       lock (locker) {
    128         if (updatingUsers) return;
    129         updatingUsers = true;
    130       }
    131       try {
    132         await Tasks.Task.Run(() => UpdateUsers());
    133       } finally {
    134         updatingUsers = false;
    135       }
     129      await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
     130        action: () => UpdateUsers(),
     131        finallyCallback: () => {
     132          ownerComboBox.SelectedIndexChanged -= ownerComboBox_SelectedIndexChanged;
     133          ownerComboBox.DataSource = AccessClient.Instance.UsersAndGroups.OfType<LightweightUser>().ToList();
     134          ownerComboBox.SelectedIndexChanged += ownerComboBox_SelectedIndexChanged;
     135        });
    136136    }
    137137
     
    141141        updatingUsers = true;
    142142      }
    143       try {
    144         await Tasks.Task.Run(() => UpdateUsers());
    145       } finally {
    146         updatingUsers = false;
    147       }
    148     }
    149 
    150     private void UpdateUsers() {
    151       ownerComboBox.DataSource = null;
    152       AccessClient.Instance.Refresh();
    153       if (Content != null) {
    154         ownerComboBox.DataSource = AccessClient.Instance.UsersAndGroups.OfType<LightweightUser>().ToList();
    155         ownerComboBox.SelectedItem = AccessClient.Instance.UsersAndGroups.FirstOrDefault(x => x.Id == Content.OwnerUserId);
    156       }
     143
     144      await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
     145        action: () => UpdateUsers(),
     146        finallyCallback: () => {
     147          ownerComboBox.SelectedIndexChanged -= ownerComboBox_SelectedIndexChanged;
     148          ownerComboBox.DataSource = AccessClient.Instance.UsersAndGroups.OfType<LightweightUser>().ToList();
     149          ownerComboBox.SelectedItem = AccessClient.Instance.UsersAndGroups.FirstOrDefault(x => x.Id == Content.OwnerUserId);
     150          ownerComboBox.SelectedIndexChanged += ownerComboBox_SelectedIndexChanged;
     151          updatingUsers = false;
     152        });
    157153    }
    158154
     
    192188      Content.EndDate = indefiniteCheckBox.Checked ? (DateTime?)null : Content.StartDate;
    193189    }
     190    #endregion
     191
     192    #region Helpers
     193    private void UpdateUsers() {
     194      try {
     195        AccessClient.Instance.Refresh();
     196      } catch (AnonymousUserException) {
     197        ShowHiveInformationDialog();
     198      }
     199    }
     200
     201    private void ShowHiveInformationDialog() {
     202      if (InvokeRequired) Invoke((Action)ShowHiveInformationDialog);
     203      else {
     204        using (HiveInformationDialog dialog = new HiveInformationDialog()) {
     205          dialog.ShowDialog(this);
     206        }
     207      }
     208    }
     209    #endregion
    194210  }
    195211}
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectsView.cs

    r15401 r15412  
    104104      removeButton.Enabled = enabled;
    105105      saveProjectButton.Enabled = enabled;
    106       savePermissionsButton.Enabled = enabled && permissionsView.FetchSelectedUsers != null;
    107       permissionsView.Enabled = enabled && permissionsView.FetchSelectedUsers != null;
     106      savePermissionsButton.Enabled = enabled && permissionsView.Content != null && permissionsView.FetchSelectedUsers != null;
     107      permissionsView.Enabled = enabled && permissionsView.Content != null && permissionsView.FetchSelectedUsers != null;
    108108    }
    109109    #endregion
     
    111111    #region Event Handlers
    112112    private void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<Project>> e) {
    113       OnContentChanged();
     113      if (InvokeRequired) Invoke((Action<object, CollectionItemsChangedEventArgs<IndexedItem<Project>>>)Content_ItemsAdded, sender, e);
     114      else {
     115        OnContentChanged();
     116      }
    114117    }
    115118
    116119    private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<Project>> e) {
    117       OnContentChanged();
     120      if (InvokeRequired) Invoke((Action<object, CollectionItemsChangedEventArgs<IndexedItem<Project>>>)Content_ItemsRemoved, sender, e);
     121      else {
     122        OnContentChanged();
     123      }
    118124    }
    119125
    120126    private void ProjectViewContent_PropertyChanged(object sender, PropertyChangedEventArgs e) {
    121       OnContentChanged();
     127      if (InvokeRequired) Invoke((Action<object, PropertyChangedEventArgs>)ProjectViewContent_PropertyChanged, sender, e);
     128      else {
     129        OnContentChanged();
     130      }
    122131    }
    123132
     
    159168
    160169    private async void ProjectsView_Load(object sender, EventArgs e) {
    161       lock (locker) {
    162         if (updatingProjects) return;
    163         updatingProjects = true;
    164       }
    165 
    166170      await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
    167171        action: () => UpdateProjects(),
    168         finallyCallback: () => updatingProjects = false);
     172        finallyCallback: () => Content = HiveAdminClient.Instance.Projects);
    169173    }
    170174
     
    177181      await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
    178182        action: () => UpdateProjects(),
    179         finallyCallback: () => updatingProjects = false);
     183        finallyCallback: () => {
     184          Content = HiveAdminClient.Instance.Projects;
     185          updatingProjects = false;
     186        });
    180187    }
    181188
     
    194201      }
    195202
    196       await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
    197         action: () => RemoveProject(),
    198         finallyCallback: () => removingProjects = false);
     203      var selectedNode = projectsTreeView.SelectedNode;
     204      if (selectedNode == null || selectedNode.Tag == null) return;
     205
     206      var project = (Project)selectedNode.Tag;
     207      var result = MessageBox.Show(
     208        "Do you really want to delete " + project.Name + "?",
     209        "HeuristicLab Hive Administrator",
     210        MessageBoxButtons.YesNo,
     211        MessageBoxIcon.Question);
     212
     213      if (result == DialogResult.Yes) {
     214        if (Content.Any(x => x.ParentProjectId == project.Id)) {
     215          MessageBox.Show(
     216            "Only empty projects can be deleted.",
     217            "HeuristicLab Hive Administrator",
     218            MessageBoxButtons.OK,
     219            MessageBoxIcon.Error);
     220        } else {
     221          await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
     222            action: () => RemoveProject(project),
     223            finallyCallback: () => {
     224              Content.Remove(project);
     225              removingProjects = false;
     226            });
     227        }
     228      }
    199229    }
    200230
     
    222252      projectView.Content = selectedProject;
    223253
    224       selectedProject.PropertyChanged += ProjectViewContent_PropertyChanged;
    225 
    226       await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
    227         action: () => UpdatePermissions());
     254      if (selectedProject != null)
     255        selectedProject.PropertyChanged += ProjectViewContent_PropertyChanged;
     256
     257      if (IsAuthorized(selectedProject)) {
     258        if (!tabControl.TabPages.Contains(permissionsTabPage))
     259          tabControl.TabPages.Add(permissionsTabPage);
     260
     261        permissionsView.FetchSelectedUsers = () =>
     262          HiveServiceLocator.Instance.CallHiveService(s => s.GetProjectPermissions(selectedProject.Id))
     263                                     .Select(x => x.GrantedUserId)
     264                                     .ToList();
     265
     266        if (tabControl.SelectedIndex == 1 && permissionsView.Content != null && permissionsView.FetchSelectedUsers != null)
     267          await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
     268            action: () => UpdatePermissions());
     269      } else {
     270        if (tabControl.TabPages.Contains(permissionsTabPage))
     271          tabControl.TabPages.Remove(permissionsTabPage);
     272        permissionsView.FetchSelectedUsers = null;
     273      }
    228274    }
    229275
     
    273319    }
    274320
    275     private void tabControl_SelectedIndexChanged(object sender, EventArgs e) {
    276       if (tabControl.SelectedIndex == 1) {
    277         UpdatePermissions();
    278       }
     321    private async void tabControl_SelectedIndexChanged(object sender, EventArgs e) {
     322      if (tabControl.SelectedIndex == 1 && permissionsView.Content != null && permissionsView.FetchSelectedUsers != null)
     323        await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
     324          action: () => UpdatePermissions());
    279325    }
    280326
     
    341387    private void UpdateProjects() {
    342388      try {
    343 
     389        HiveAdminClient.Instance.Refresh();
    344390      } catch (AnonymousUserException) {
    345391        ShowHiveInformationDialog();
    346392      }
    347       HiveAdminClient.Instance.Refresh();
    348       Content = HiveAdminClient.Instance.Projects;
    349     }
    350 
    351     private void RemoveProject() {
    352       var selectedNode = projectsTreeView.SelectedNode;
    353       if (selectedNode == null || selectedNode.Tag == null) return;
    354 
    355       var project = (Project)selectedNode.Tag;
    356       var result = MessageBox.Show(
    357         "Do you really want to delete " + project.Name + "?",
    358         "HeuristicLab Hive Administrator",
    359         MessageBoxButtons.YesNo,
    360         MessageBoxIcon.Question);
    361 
    362       if (result == DialogResult.Yes) {
    363         if (Content.Any(x => x.ParentProjectId == project.Id)) {
    364           MessageBox.Show(
    365             "Only empty projects can be deleted.",
    366             "HeuristicLab Hive Administrator",
    367             MessageBoxButtons.OK,
    368             MessageBoxIcon.Error);
    369         } else {
    370           Content.Remove(project);
    371           HiveAdminClient.Delete(project);
    372         }
     393    }
     394
     395    private void RemoveProject(Project project) {
     396      try {
     397        HiveAdminClient.Delete(project);
     398      } catch (AnonymousUserException) {
     399        ShowHiveInformationDialog();
    373400      }
    374401    }
    375402
    376403    private void UpdatePermissions() {
    377       var selectedNode = projectsTreeView.SelectedNode;
    378       var project = (Project)selectedNode?.Tag;
    379 
    380       if (IsAuthorized(project)) {
    381         permissionsView.FetchSelectedUsers = () =>
    382           HiveServiceLocator.Instance.CallHiveService(s => s.GetProjectPermissions(project.Id))
    383                                             .Select(x => x.GrantedUserId)
    384                                             .ToList();
    385 
    386         savePermissionsButton.Enabled = true;
    387 
    388         if (!tabControl.TabPages.Contains(permissionsTabPage))
    389           tabControl.TabPages.Add(permissionsTabPage);
    390 
    391         if (tabControl.SelectedIndex == 1 && permissionsView.Content != null && permissionsView.FetchSelectedUsers != null)
    392           permissionsView.ManualRefresh();
    393       } else {
    394         permissionsView.FetchSelectedUsers = null;
    395         savePermissionsButton.Enabled = false;
    396 
    397         if (tabControl.TabPages.Contains(permissionsTabPage))
    398           tabControl.TabPages.Remove(permissionsTabPage);
     404      try {
     405        permissionsView.ManualRefresh();
     406      } catch (AnonymousUserException) {
     407        ShowHiveInformationDialog();
    399408      }
    400409    }
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.Designer.cs

    r15401 r15412  
    5353    private void InitializeComponent() {
    5454      this.components = new System.ComponentModel.Container();
    55       System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ResourcesView));
    5655      this.imageListSlaveGroups = new System.Windows.Forms.ImageList(this.components);
    5756      this.splitSlaves = new System.Windows.Forms.SplitContainer();
     
    6362      this.tabSlaveGroup = new System.Windows.Forms.TabControl();
    6463      this.tabDetails = new System.Windows.Forms.TabPage();
     64      this.tabSchedule = new System.Windows.Forms.TabPage();
     65      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    6566      this.slaveView = new HeuristicLab.Clients.Hive.Administrator.Views.SlaveView();
    66       this.tabSchedule = new System.Windows.Forms.TabPage();
    6767      this.scheduleView = new HeuristicLab.Clients.Hive.Administrator.Views.ScheduleView();
    68       this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    6968      ((System.ComponentModel.ISupportInitialize)(this.splitSlaves)).BeginInit();
    7069      this.splitSlaves.Panel1.SuspendLayout();
     
    194193      this.tabDetails.UseVisualStyleBackColor = true;
    195194      //
    196       // slaveView
    197       //
    198       this.slaveView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    199             | System.Windows.Forms.AnchorStyles.Left)
    200             | System.Windows.Forms.AnchorStyles.Right)));
    201       this.slaveView.Caption = "SlaveView";
    202       this.slaveView.Content = null;
    203       this.slaveView.Location = new System.Drawing.Point(6, 6);
    204       this.slaveView.Name = "slaveView";
    205       this.slaveView.ReadOnly = false;
    206       this.slaveView.Size = new System.Drawing.Size(565, 503);
    207       this.slaveView.TabIndex = 0;
    208       //
    209195      // tabSchedule
    210196      //
     
    217203      this.tabSchedule.Text = "Schedule";
    218204      this.tabSchedule.UseVisualStyleBackColor = true;
     205      //
     206      // slaveView
     207      //
     208      this.slaveView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     209            | System.Windows.Forms.AnchorStyles.Left)
     210            | System.Windows.Forms.AnchorStyles.Right)));
     211      this.slaveView.Caption = "SlaveView";
     212      this.slaveView.Content = null;
     213      this.slaveView.Location = new System.Drawing.Point(6, 6);
     214      this.slaveView.Name = "slaveView";
     215      this.slaveView.ReadOnly = false;
     216      this.slaveView.Size = new System.Drawing.Size(565, 503);
     217      this.slaveView.TabIndex = 0;
    219218      //
    220219      // scheduleView
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs

    r15401 r15412  
    2727using HeuristicLab.Clients.Access;
    2828using HeuristicLab.Clients.Hive.Views;
     29using HeuristicLab.Collections;
    2930using HeuristicLab.Common.Resources;
    3031using HeuristicLab.Core;
     
    144145
    145146    #region Event Handlers
    146     private void Content_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<Collections.IndexedItem<Resource>> e) {
    147       OnContentChanged();
    148     }
    149 
    150     private void Content_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<Collections.IndexedItem<Resource>> e) {
    151       OnContentChanged();
     147    private void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<Resource>> e) {
     148      if (InvokeRequired) Invoke((Action<object, CollectionItemsChangedEventArgs<IndexedItem<Resource>>>)Content_ItemsAdded, sender, e);
     149      else {
     150        OnContentChanged();
     151      }
     152    }
     153
     154    private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<Resource>> e) {
     155      if (InvokeRequired) Invoke((Action<object, CollectionItemsChangedEventArgs<IndexedItem<Resource>>>)Content_ItemsRemoved, sender, e);
     156      else {
     157        OnContentChanged();
     158      }
    152159    }
    153160
    154161    private void SlaveViewContent_PropertyChanged(object sender, PropertyChangedEventArgs e) {
    155       OnContentChanged();
    156       if (e.PropertyName == "HbInterval") {
    157         UpdateChildHbIntervall(slaveView.Content);
     162      if (InvokeRequired) Invoke((Action<object, PropertyChangedEventArgs>)SlaveViewContent_PropertyChanged, sender, e);
     163      else {
     164        OnContentChanged();
     165        if (e.PropertyName == "HbInterval") {
     166          UpdateChildHbIntervall(slaveView.Content);
     167        }
    158168      }
    159169    }
     
    196206
    197207    private async void ResourcesView_Load(object sender, EventArgs e) {
    198       lock (locker) {
    199         if (updatingResources) return;
    200         updatingResources = true;
    201       }
    202 
    203208      await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
    204         action: () => UpdateResources(),
    205         finallyCallback: () => updatingResources = false);
     209        action: () => UpdateResources());
    206210    }
    207211
     
    259263      slaveView.Content = selectedResource;
    260264
    261       if (selectedResource is SlaveGroup)
    262         slaveView.Content.PropertyChanged += SlaveViewContent_PropertyChanged;
    263 
    264       await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
    265         action: () => UpdateSchedule());
     265      if (selectedResource != null && selectedResource is SlaveGroup)
     266        selectedResource.PropertyChanged += SlaveViewContent_PropertyChanged;
     267
     268      if (IsAuthorized(selectedResource)) {
     269        if (!tabSlaveGroup.TabPages.Contains(tabSchedule))
     270          tabSlaveGroup.TabPages.Add(tabSchedule);
     271
     272        HiveAdminClient.Instance.DowntimeForResourceId = selectedResource.Id;
     273
     274        if (tabSlaveGroup.SelectedIndex == 1) {
     275          await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
     276            action: () => UpdateSchedule(),
     277            finallyCallback: () => scheduleView.Content = HiveAdminClient.Instance.Downtimes);
     278        }
     279      } else {
     280        if (tabSlaveGroup.TabPages.Contains(tabSchedule))
     281          tabSlaveGroup.TabPages.Remove(tabSchedule);
     282        HiveAdminClient.Instance.DowntimeForResourceId = Guid.Empty;
     283      }
    266284    }
    267285
     
    412430
    413431    private void UpdateResources() {
    414       try {
    415         ResetView();
    416         HiveAdminClient.Instance.Refresh();
    417         Content = HiveAdminClient.Instance.Resources;
    418       } catch (AnonymousUserException) {
    419         ShowHiveInformationDialog();
    420       }
     432      HiveAdminClient.Instance.Refresh();
     433      Content = HiveAdminClient.Instance.Resources;
    421434    }
    422435
     
    452465
    453466    private void UpdateSchedule() {
    454       var selectedNode = treeSlaveGroup.SelectedNode;
    455       var resource = (Resource)selectedNode?.Tag;
    456 
    457       if (IsAuthorized(resource)) {
    458         if (!tabSlaveGroup.TabPages.Contains(tabSchedule))
    459           tabSlaveGroup.TabPages.Add(tabSchedule);
    460 
    461         if (tabSlaveGroup.SelectedIndex == 1) {
    462           HiveAdminClient.Instance.DowntimeForResourceId = resource.Id;
    463           HiveAdminClient.Instance.RefreshCalendar();
    464           scheduleView.Invoke((Action)(() => {
    465             scheduleView.Content = HiveAdminClient.Instance.Downtimes;
    466             SetEnabledStateOfControls();
    467           }));
    468         }
    469       } else {
    470         if (tabSlaveGroup.TabPages.Contains(tabSchedule))
    471           tabSlaveGroup.TabPages.Remove(tabSchedule);
     467      try {
     468        HiveAdminClient.Instance.RefreshCalendar();
     469      } catch (AnonymousUserException) {
     470        ShowHiveInformationDialog();
    472471      }
    473472    }
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/SlaveView.cs

    r14185 r15412  
    125125    protected override void SetEnabledStateOfControls() {
    126126      base.SetEnabledStateOfControls();
     127      bool enabled = Content != null;
     128      txtName.Enabled = enabled;
     129      txtHbIntervall.Enabled = enabled;
     130      cbxPublic.Enabled = enabled;
    127131    }
    128132
     
    139143            int interval = int.Parse(txtHbIntervall.Text);
    140144            Content.HbInterval = interval;
    141           }
    142           catch (Exception) {
     145          } catch (Exception) {
    143146            MessageBox.Show("Please enter a numeric value for the Heartbeat Interval.", "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error);
    144147            txtHbIntervall.Text = "10";
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/HeuristicLab.Clients.Hive.JobManager-3.3.csproj

    r15401 r15412  
    164164      <Private>False</Private>
    165165    </ProjectReference>
     166    <ProjectReference Include="..\..\HeuristicLab.Clients.Common\3.3\HeuristicLab.Clients.Common-3.3.csproj">
     167      <Project>{730a9104-d4d1-4360-966b-e49b7571dda3}</Project>
     168      <Name>HeuristicLab.Clients.Common-3.3</Name>
     169      <Private>False</Private>
     170    </ProjectReference>
    166171    <ProjectReference Include="..\..\HeuristicLab.Clients.Hive.Views\3.3\HeuristicLab.Clients.Hive.Views-3.3.csproj">
    167172      <Project>{E1D6C801-892A-406A-B606-F158E36DD3C3}</Project>
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.Designer.cs

    r15401 r15412  
    4646    private void InitializeComponent() {
    4747      this.components = new System.ComponentModel.Container();
    48       this.resourcesGroupBox = new System.Windows.Forms.GroupBox();
    49       this.splitContainer = new System.Windows.Forms.SplitContainer();
    50       this.resourcesTreeView = new System.Windows.Forms.TreeView();
    51       this.imageList = new System.Windows.Forms.ImageList(this.components);
     48      this.projectsGroupBox = new System.Windows.Forms.GroupBox();
     49      this.projectsImageList = new System.Windows.Forms.ImageList(this.components);
     50      this.resourcesImageList = new System.Windows.Forms.ImageList(this.components);
    5251      this.searchLabel = new System.Windows.Forms.Label();
    5352      this.searchTextBox = new System.Windows.Forms.TextBox();
    54       this.descriptionTextBox = new System.Windows.Forms.TextBox();
    5553      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    56       this.resourcesGroupBox.SuspendLayout();
    57       ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
    58       this.splitContainer.Panel1.SuspendLayout();
    59       this.splitContainer.Panel2.SuspendLayout();
    60       this.splitContainer.SuspendLayout();
     54      this.splitContainer2 = new System.Windows.Forms.SplitContainer();
     55      this.projectsTreeView = new System.Windows.Forms.TreeView();
     56      this.resourcesTreeView = new System.Windows.Forms.TreeView();
     57      this.summaryGroupBox = new System.Windows.Forms.GroupBox();
     58      this.coresLabel = new System.Windows.Forms.Label();
     59      this.coresSummaryLabel = new System.Windows.Forms.Label();
     60      this.memoryLabel = new System.Windows.Forms.Label();
     61      this.memorySummaryLabel = new System.Windows.Forms.Label();
     62      this.projectsGroupBox.SuspendLayout();
     63      ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
     64      this.splitContainer2.Panel1.SuspendLayout();
     65      this.splitContainer2.Panel2.SuspendLayout();
     66      this.splitContainer2.SuspendLayout();
     67      this.summaryGroupBox.SuspendLayout();
    6168      this.SuspendLayout();
    6269      //
    63       // resourcesGroupBox
    64       //
    65       this.resourcesGroupBox.Controls.Add(this.splitContainer);
    66       this.resourcesGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
    67       this.resourcesGroupBox.Location = new System.Drawing.Point(0, 0);
    68       this.resourcesGroupBox.Name = "resourcesGroupBox";
    69       this.resourcesGroupBox.Size = new System.Drawing.Size(308, 365);
    70       this.resourcesGroupBox.TabIndex = 0;
    71       this.resourcesGroupBox.TabStop = false;
    72       this.resourcesGroupBox.Text = "Available Projects";
    73       //
    74       // splitContainer
    75       //
    76       this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
    77       this.splitContainer.Location = new System.Drawing.Point(3, 16);
    78       this.splitContainer.Name = "splitContainer";
    79       this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
    80       //
    81       // splitContainer.Panel1
    82       //
    83       this.splitContainer.Panel1.Controls.Add(this.resourcesTreeView);
    84       this.splitContainer.Panel1.Controls.Add(this.searchLabel);
    85       this.splitContainer.Panel1.Controls.Add(this.searchTextBox);
    86       //
    87       // splitContainer.Panel2
    88       //
    89       this.splitContainer.Panel2.Controls.Add(this.descriptionTextBox);
    90       this.splitContainer.Size = new System.Drawing.Size(302, 346);
    91       this.splitContainer.SplitterDistance = 219;
    92       this.splitContainer.TabIndex = 0;
    93       //
    94       // resourcesTreeView
    95       //
    96       this.resourcesTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     70      // projectsGroupBox
     71      //
     72      this.projectsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    9773            | System.Windows.Forms.AnchorStyles.Left)
    9874            | System.Windows.Forms.AnchorStyles.Right)));
    99       this.resourcesTreeView.CheckBoxes = true;
    100       this.resourcesTreeView.HideSelection = false;
    101       this.resourcesTreeView.ImageIndex = 0;
    102       this.resourcesTreeView.ImageList = this.imageList;
    103       this.resourcesTreeView.Location = new System.Drawing.Point(3, 29);
    104       this.resourcesTreeView.Name = "resourcesTreeView";
    105       this.resourcesTreeView.SelectedImageIndex = 0;
    106       this.resourcesTreeView.ShowNodeToolTips = true;
    107       this.resourcesTreeView.Size = new System.Drawing.Size(296, 196);
    108       this.resourcesTreeView.TabIndex = 2;
    109       this.resourcesTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.resourcesTreeView_AfterCheck);
    110       this.resourcesTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.resourcesTreeView_AfterSelect);
    111       //
    112       // imageList
    113       //
    114       this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
    115       this.imageList.ImageSize = new System.Drawing.Size(16, 16);
    116       this.imageList.TransparentColor = System.Drawing.Color.Transparent;
     75      this.projectsGroupBox.Controls.Add(this.searchLabel);
     76      this.projectsGroupBox.Controls.Add(this.splitContainer2);
     77      this.projectsGroupBox.Controls.Add(this.searchTextBox);
     78      this.projectsGroupBox.Location = new System.Drawing.Point(3, 3);
     79      this.projectsGroupBox.Name = "projectsGroupBox";
     80      this.projectsGroupBox.Size = new System.Drawing.Size(426, 461);
     81      this.projectsGroupBox.TabIndex = 0;
     82      this.projectsGroupBox.TabStop = false;
     83      this.projectsGroupBox.Text = "Available Projects";
     84      //
     85      // projectsImageList
     86      //
     87      this.projectsImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     88      this.projectsImageList.ImageSize = new System.Drawing.Size(16, 16);
     89      this.projectsImageList.TransparentColor = System.Drawing.Color.Transparent;
     90      //
     91      // resourcesImageList
     92      //
     93      this.resourcesImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     94      this.resourcesImageList.ImageSize = new System.Drawing.Size(16, 16);
     95      this.resourcesImageList.TransparentColor = System.Drawing.Color.Transparent;
    11796      //
    11897      // searchLabel
    11998      //
    12099      this.searchLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Zoom;
    121       this.searchLabel.Location = new System.Drawing.Point(3, 3);
     100      this.searchLabel.Location = new System.Drawing.Point(6, 19);
    122101      this.searchLabel.Name = "searchLabel";
    123102      this.searchLabel.Size = new System.Drawing.Size(20, 20);
     
    129108      this.searchTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    130109            | System.Windows.Forms.AnchorStyles.Right)));
    131       this.searchTextBox.Location = new System.Drawing.Point(29, 3);
     110      this.searchTextBox.Location = new System.Drawing.Point(32, 19);
    132111      this.searchTextBox.Name = "searchTextBox";
    133       this.searchTextBox.Size = new System.Drawing.Size(270, 20);
     112      this.searchTextBox.Size = new System.Drawing.Size(388, 20);
    134113      this.searchTextBox.TabIndex = 1;
    135114      this.toolTip.SetToolTip(this.searchTextBox, "Enter string to search for resources");
    136115      this.searchTextBox.TextChanged += new System.EventHandler(this.searchTextBox_TextChanged);
    137116      //
    138       // descriptionTextBox
    139       //
    140       this.descriptionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     117      // splitContainer2
     118      //
     119      this.splitContainer2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    141120            | System.Windows.Forms.AnchorStyles.Left)
    142121            | System.Windows.Forms.AnchorStyles.Right)));
    143       this.descriptionTextBox.Font = new System.Drawing.Font("Courier New", 8.25F);
    144       this.descriptionTextBox.Location = new System.Drawing.Point(3, 3);
    145       this.descriptionTextBox.Multiline = true;
    146       this.descriptionTextBox.Name = "descriptionTextBox";
    147       this.descriptionTextBox.ReadOnly = true;
    148       this.descriptionTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
    149       this.descriptionTextBox.Size = new System.Drawing.Size(296, 108);
    150       this.descriptionTextBox.TabIndex = 0;
    151       this.descriptionTextBox.WordWrap = false;
    152       //
    153       // HiveResourceSelector
     122      this.splitContainer2.Location = new System.Drawing.Point(6, 45);
     123      this.splitContainer2.Name = "splitContainer2";
     124      //
     125      // splitContainer2.Panel1
     126      //
     127      this.splitContainer2.Panel1.Controls.Add(this.projectsTreeView);
     128      //
     129      // splitContainer2.Panel2
     130      //
     131      this.splitContainer2.Panel2.Controls.Add(this.resourcesTreeView);
     132      this.splitContainer2.Size = new System.Drawing.Size(414, 410);
     133      this.splitContainer2.SplitterDistance = 204;
     134      this.splitContainer2.TabIndex = 4;
     135      //
     136      // projectsTreeView
     137      //
     138      this.projectsTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
     139      this.projectsTreeView.HideSelection = false;
     140      this.projectsTreeView.ImageIndex = 0;
     141      this.projectsTreeView.ImageList = this.projectsImageList;
     142      this.projectsTreeView.Location = new System.Drawing.Point(0, 0);
     143      this.projectsTreeView.Name = "projectsTreeView";
     144      this.projectsTreeView.SelectedImageIndex = 0;
     145      this.projectsTreeView.ShowNodeToolTips = true;
     146      this.projectsTreeView.Size = new System.Drawing.Size(204, 410);
     147      this.projectsTreeView.TabIndex = 3;
     148      this.projectsTreeView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.projectsTreeView_MouseDoubleClick);
     149      this.projectsTreeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.projectsTreeView_MouseDown);
     150      //
     151      // resourcesTreeView
     152      //
     153      this.resourcesTreeView.CheckBoxes = true;
     154      this.resourcesTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
     155      this.resourcesTreeView.ImageIndex = 0;
     156      this.resourcesTreeView.ImageList = this.resourcesImageList;
     157      this.resourcesTreeView.Location = new System.Drawing.Point(0, 0);
     158      this.resourcesTreeView.Name = "resourcesTreeView";
     159      this.resourcesTreeView.SelectedImageIndex = 0;
     160      this.resourcesTreeView.Size = new System.Drawing.Size(206, 410);
     161      this.resourcesTreeView.TabIndex = 0;
     162      this.resourcesTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.resourcesTreeView_AfterCheck);
     163      this.resourcesTreeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.resourcesTreeView_MouseDown);
     164      //
     165      // summaryGroupBox
     166      //
     167      this.summaryGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
     168            | System.Windows.Forms.AnchorStyles.Right)));
     169      this.summaryGroupBox.Controls.Add(this.memorySummaryLabel);
     170      this.summaryGroupBox.Controls.Add(this.memoryLabel);
     171      this.summaryGroupBox.Controls.Add(this.coresSummaryLabel);
     172      this.summaryGroupBox.Controls.Add(this.coresLabel);
     173      this.summaryGroupBox.Location = new System.Drawing.Point(3, 470);
     174      this.summaryGroupBox.Name = "summaryGroupBox";
     175      this.summaryGroupBox.Size = new System.Drawing.Size(426, 71);
     176      this.summaryGroupBox.TabIndex = 1;
     177      this.summaryGroupBox.TabStop = false;
     178      this.summaryGroupBox.Text = "Computing Resources";
     179      //
     180      // coresLabel
     181      //
     182      this.coresLabel.AutoSize = true;
     183      this.coresLabel.Location = new System.Drawing.Point(6, 22);
     184      this.coresLabel.Name = "coresLabel";
     185      this.coresLabel.Size = new System.Drawing.Size(37, 13);
     186      this.coresLabel.TabIndex = 1;
     187      this.coresLabel.Text = "Cores:";
     188      //
     189      // coresSummaryLabel
     190      //
     191      this.coresSummaryLabel.AutoSize = true;
     192      this.coresSummaryLabel.Location = new System.Drawing.Point(59, 22);
     193      this.coresSummaryLabel.Name = "coresSummaryLabel";
     194      this.coresSummaryLabel.Size = new System.Drawing.Size(124, 13);
     195      this.coresSummaryLabel.TabIndex = 5;
     196      this.coresSummaryLabel.Text = "0 Total (0 Free / 0 Used)";
     197      //
     198      // memoryLabel
     199      //
     200      this.memoryLabel.AutoSize = true;
     201      this.memoryLabel.Location = new System.Drawing.Point(6, 48);
     202      this.memoryLabel.Name = "memoryLabel";
     203      this.memoryLabel.Size = new System.Drawing.Size(47, 13);
     204      this.memoryLabel.TabIndex = 7;
     205      this.memoryLabel.Text = "Memory:";
     206      //
     207      // memorySummaryLabel
     208      //
     209      this.memorySummaryLabel.AutoSize = true;
     210      this.memorySummaryLabel.Location = new System.Drawing.Point(59, 48);
     211      this.memorySummaryLabel.Name = "memorySummaryLabel";
     212      this.memorySummaryLabel.Size = new System.Drawing.Size(223, 13);
     213      this.memorySummaryLabel.TabIndex = 8;
     214      this.memorySummaryLabel.Text = "0.00 GB Total (0.00 GB Free / 0.00 GB Used)";
     215      //
     216      // HiveProjectSelector
    154217      //
    155218      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    156       this.Controls.Add(this.resourcesGroupBox);
    157       this.Name = "HiveResourceSelector";
    158       this.Size = new System.Drawing.Size(308, 365);
    159       this.resourcesGroupBox.ResumeLayout(false);
    160       this.splitContainer.Panel1.ResumeLayout(false);
    161       this.splitContainer.Panel1.PerformLayout();
    162       this.splitContainer.Panel2.ResumeLayout(false);
    163       this.splitContainer.Panel2.PerformLayout();
    164       ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
    165       this.splitContainer.ResumeLayout(false);
     219      this.Controls.Add(this.summaryGroupBox);
     220      this.Controls.Add(this.projectsGroupBox);
     221      this.Name = "HiveProjectSelector";
     222      this.Size = new System.Drawing.Size(432, 544);
     223      this.Load += new System.EventHandler(this.HiveProjectSelector_Load);
     224      this.projectsGroupBox.ResumeLayout(false);
     225      this.projectsGroupBox.PerformLayout();
     226      this.splitContainer2.Panel1.ResumeLayout(false);
     227      this.splitContainer2.Panel2.ResumeLayout(false);
     228      ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
     229      this.splitContainer2.ResumeLayout(false);
     230      this.summaryGroupBox.ResumeLayout(false);
     231      this.summaryGroupBox.PerformLayout();
    166232      this.ResumeLayout(false);
    167233
     
    170236    #endregion
    171237
    172     protected System.Windows.Forms.GroupBox resourcesGroupBox;
    173     protected System.Windows.Forms.SplitContainer splitContainer;
     238    protected System.Windows.Forms.GroupBox projectsGroupBox;
    174239    protected System.Windows.Forms.Label searchLabel;
    175240    protected System.Windows.Forms.TextBox searchTextBox;
     241    protected System.Windows.Forms.ImageList projectsImageList;
     242    protected System.Windows.Forms.ToolTip toolTip;
     243    private System.Windows.Forms.ImageList resourcesImageList;
     244    private System.Windows.Forms.SplitContainer splitContainer2;
     245    protected System.Windows.Forms.TreeView projectsTreeView;
    176246    protected System.Windows.Forms.TreeView resourcesTreeView;
    177     protected System.Windows.Forms.TextBox descriptionTextBox;
    178     protected System.Windows.Forms.ImageList imageList;
    179     protected System.Windows.Forms.ToolTip toolTip;
    180 
     247    private System.Windows.Forms.GroupBox summaryGroupBox;
     248    private System.Windows.Forms.Label coresLabel;
     249    private System.Windows.Forms.Label memorySummaryLabel;
     250    private System.Windows.Forms.Label memoryLabel;
     251    private System.Windows.Forms.Label coresSummaryLabel;
    181252  }
    182253}
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs

    r15401 r15412  
    2525using System.Linq;
    2626using System.Windows.Forms;
     27using HeuristicLab.Collections;
     28using HeuristicLab.Common.Resources;
    2729using HeuristicLab.Core;
    2830using HeuristicLab.Core.Views;
     
    3638    private const int greenFlagImageIndex = 0;
    3739    private const int redFlagImageIndex = 1;
     40    private const int slaveImageIndex = 0;
     41    private const int slaveGroupImageIndex = 1;
     42
     43    private readonly ISet<TreeNode> mainTreeNodes = new HashSet<TreeNode>();
     44    private readonly ISet<TreeNode> filteredTreeNodes = new HashSet<TreeNode>();
     45    private readonly ISet<TreeNode> nodeStore = new HashSet<TreeNode>();
     46    private readonly ISet<Resource> resources = new HashSet<Resource>();
     47
    3848    private string currentSearchString;
    39     private ISet<TreeNode> mainTreeNodes;
    40     private ISet<TreeNode> filteredTreeNodes;
    41     private ISet<TreeNode> nodeStore;
    42 
    43     private ISet<Project> selectedResources;
    44     public ISet<Project> SelectedResources {
    45       get { return selectedResources; }
    46       set { selectedResources = value; }
    47     }
    48 
     49
     50    private Project selectedProject;
    4951    public Project SelectedProject {
    50       get { return (Project)resourcesTreeView.SelectedNode.Tag; }
    51     }
     52      get { return selectedProject; }
     53      set {
     54        if (selectedProject == value) return;
     55        selectedProject = value;
     56        UpdateResources();
     57        OnSelectedProjectChanged();
     58      }
     59    }
     60
     61    private readonly IObservableSet<Resource> selectedResources = new ObservableSet<Resource>();
     62    public IEnumerable<Resource> SelectedResources { get { return selectedResources; } }
    5263
    5364    public new IItemList<Project> Content {
     
    5869    public HiveProjectSelector() {
    5970      InitializeComponent();
    60       mainTreeNodes = new HashSet<TreeNode>();
    61       filteredTreeNodes = new HashSet<TreeNode>();
    62       nodeStore = new HashSet<TreeNode>();
    63       selectedResources = new HashSet<Project>();
    64       imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.FlagGreen);
    65       imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.FlagRed);
    66     }
    67 
    68     public void StartProgressView() {
    69       if (InvokeRequired) {
    70         Invoke(new Action(StartProgressView));
    71       } else {
    72         var message = "Downloading projects. Please be patient.";
    73         MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, message);
    74       }
    75     }
    76 
    77     public void FinishProgressView() {
    78       if (InvokeRequired) {
    79         Invoke(new Action(FinishProgressView));
    80       } else {
    81         MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
    82       }
    83     }
    84 
     71
     72      projectsImageList.Images.Add(VSImageLibrary.FlagGreen);
     73      projectsImageList.Images.Add(VSImageLibrary.FlagRed);
     74      resourcesImageList.Images.Add(VSImageLibrary.MonitorLarge);
     75      resourcesImageList.Images.Add(VSImageLibrary.NetworkCenterLarge);
     76    }
     77
     78    #region Overrides
    8579    protected override void OnContentChanged() {
    8680      base.OnContentChanged();
    8781
    8882      if (Content != null) {
    89         selectedResources = new HashSet<Project>(Content.Where(x => selectedResources.Any(y => x.Id == y.Id)));
    9083        UpdateMainTree();
    9184        ExtractStatistics();
     
    9487        UpdateFilteredTree();
    9588      }
    96     }
    97 
    98     #region MainTree Methods
     89
     90      SelectedProject = null;
     91    }
     92    #endregion
     93
     94    #region Event Handlers
     95    private void HiveProjectSelector_Load(object sender, EventArgs e) {
     96      projectsTreeView.Nodes.Clear();
     97      resourcesTreeView.Nodes.Clear();
     98      SelectedProject = null;
     99    }
     100
     101    private void searchTextBox_TextChanged(object sender, EventArgs e) {
     102      currentSearchString = searchTextBox.Text.ToLower();
     103      UpdateFilteredTree();
     104    }
     105
     106    private void projectsTreeView_MouseDoubleClick(object sender, MouseEventArgs e) {
     107      OnProjectsTreeViewDoubleClicked();
     108    }
     109
     110    private void projectsTreeView_MouseDown(object sender, MouseEventArgs e) {
     111      var node = projectsTreeView.GetNodeAt(new Point(e.X, e.Y));
     112
     113      SelectedProject = (Project)node?.Tag;
     114
     115      if (node == null) {
     116        projectsTreeView.SelectedNode = null;
     117      }
     118
     119      ExtractStatistics();
     120    }
     121
     122    private void resourcesTreeView_MouseDown(object sender, MouseEventArgs e) {
     123      var node = resourcesTreeView.GetNodeAt(new Point(e.X, e.Y));
     124
     125      if (node == null) {
     126        resourcesTreeView.SelectedNode = null;
     127      }
     128
     129      ExtractStatistics((Resource)node?.Tag);
     130    }
     131
     132    private void resourcesTreeView_AfterCheck(object sender, TreeViewEventArgs e) {
     133      var resource = (Resource)e.Node.Tag;
     134
     135      if (e.Node.Checked)
     136        selectedResources.Add(resource);
     137      else
     138        selectedResources.Remove(resource);
     139
     140      ExtractStatistics((Resource)resourcesTreeView.SelectedNode?.Tag);
     141      OnSelectedResourcesChanged();
     142    }
     143    #endregion
     144
     145    #region Helpers
    99146    private void UpdateMainTree() {
    100147      mainTreeNodes.Clear();
    101148
    102149      foreach (Project g in Content.OrderBy(x => x.Name)) {
    103         //root node
    104150        if (g.ParentProjectId == null) {
    105151          TreeNode tn = new TreeNode();
     
    131177      }
    132178    }
    133     #endregion
    134 
    135     #region FilteredTree Methods
     179
    136180    private void UpdateFilteredTree() {
    137181      filteredTreeNodes.Clear();
     
    144188        }
    145189      }
    146       UpdateResourceTree();
    147     }
    148 
    149     private void TraverseParentNodes(TreeNode node) {
    150       if (node != null) {
    151         for (TreeNode parent = node.Parent; parent != null; parent = parent.Parent)
    152           filteredTreeNodes.Add(parent);
    153       }
    154     }
    155     #endregion
    156 
    157     #region ResourceTree Methods
    158     private void UpdateResourceTree() {
    159       resourcesTreeView.Nodes.Clear();
     190      UpdateProjectsTree();
     191    }
     192
     193    private void UpdateProjectsTree() {
     194      projectsTreeView.Nodes.Clear();
    160195      nodeStore.Clear();
    161196
     
    178213          }
    179214      }
    180       resourcesTreeView.Nodes.AddRange(nodeStore.Where(x => ((Project)x.Tag).ParentProjectId == null).ToArray());
     215      projectsTreeView.Nodes.AddRange(nodeStore.Where(x => ((Project)x.Tag).ParentProjectId == null).ToArray());
    181216      if (string.IsNullOrEmpty(currentSearchString)) ExpandSlaveGroupNodes();
    182       else resourcesTreeView.ExpandAll();
    183     }
    184     #endregion
    185 
    186     #region Events
    187     private void resourcesTreeView_AfterCheck(object sender, TreeViewEventArgs e) {
    188       //if (e.Action != TreeViewAction.Unknown) {
    189       //  if (e.Node.Checked) {
    190       //    IncludeChildNodes(mainTreeNodes.SingleOrDefault(x => ((Project)x.Tag).Id == ((Project)e.Node.Tag).Id));
    191       //    IncludeParentNodes(mainTreeNodes.SingleOrDefault(x => ((Project)x.Tag).Id == ((Project)e.Node.Tag).Id));
    192       //  } else {
    193       //    ExcludeChildNodes(mainTreeNodes.SingleOrDefault(x => ((Project)x.Tag).Id == ((Project)e.Node.Tag).Id));
    194       //    ExcludeParentNodes(mainTreeNodes.SingleOrDefault(x => ((Project)x.Tag).Id == ((Project)e.Node.Tag).Id));
    195       //  }
    196       //  ExtractStatistics();
    197       //}
    198     }
    199 
    200     private void resourcesTreeView_AfterSelect(object sender, TreeViewEventArgs e) {
    201       if (e.Action != TreeViewAction.Unknown) {
    202         ExtractStatistics(e.Node);
    203       }
    204     }
    205 
    206     private void searchTextBox_TextChanged(object sender, System.EventArgs e) {
    207       currentSearchString = searchTextBox.Text.ToLower();
    208       UpdateFilteredTree();
    209     }
    210     #endregion
    211 
    212     #region Helpers
     217      else projectsTreeView.ExpandAll();
     218    }
     219
     220    private void TraverseParentNodes(TreeNode node) {
     221      if (node != null) {
     222        for (TreeNode parent = node.Parent; parent != null; parent = parent.Parent)
     223          filteredTreeNodes.Add(parent);
     224      }
     225    }
     226
     227    private void UpdateResources() {
     228      selectedResources.Clear();
     229
     230      if (selectedProject != null) {
     231        var assignedResources = HiveServiceLocator.Instance.CallHiveService(s => s.GetAssignedResourcesForProject(selectedProject.Id));
     232        var assignedResourceIds = new HashSet<Guid>(assignedResources.Select(x => x.ResourceId));
     233
     234        foreach (var resource in HiveAdminClient.Instance.Resources) {
     235          if (assignedResourceIds.Contains(resource.Id)) {
     236            resources.Add(resource);
     237            selectedResources.Add(resource);
     238          }
     239        }
     240      }
     241
     242      BuildResourceTree(selectedResources);
     243      ExtractStatistics();
     244      OnSelectedResourcesChanged();
     245    }
     246
     247    private Resource BuildResourceTree(IEnumerable<Resource> resources) {
     248      resourcesTreeView.Nodes.Clear();
     249      if (!resources.Any()) return null;
     250
     251      var mainResources = new HashSet<Resource>(resources.Where(x => x.ParentResourceId == null));
     252      var subResources = new HashSet<Resource>(resources.Except(mainResources));
     253
     254      var stack = new Stack<Resource>(mainResources.OrderByDescending(x => x.Name));
     255      var top = stack.Peek();
     256
     257      TreeNode currentNode = null;
     258      Resource currentResource = null;
     259
     260      while (stack.Any()) {
     261        var newResource = stack.Pop();
     262        var newNode = new TreeNode(newResource.Name) {
     263          Checked = true,
     264          ImageIndex = newResource is Slave ? slaveImageIndex : slaveGroupImageIndex,
     265          Tag = newResource
     266        };
     267
     268        while (currentNode != null && newResource.ParentResourceId != currentResource.Id) {
     269          currentNode = currentNode.Parent;
     270          currentResource = currentNode == null ? null : (Resource)currentNode.Tag;
     271        }
     272
     273        if (currentNode == null) {
     274          resourcesTreeView.Nodes.Add(newNode);
     275        } else {
     276          currentNode.Nodes.Add(newNode);
     277        }
     278
     279        newNode.SelectedImageIndex = newNode.ImageIndex;
     280
     281        var childResources = subResources.Where(x => x.ParentResourceId == newResource.Id);
     282        if (childResources.Any()) {
     283          foreach (var resource in childResources.OrderByDescending(x => x.Name)) {
     284            subResources.Remove(resource);
     285            stack.Push(resource);
     286          }
     287          currentNode = newNode;
     288          currentResource = newResource;
     289        }
     290      }
     291
     292      resourcesTreeView.ExpandAll();
     293
     294      return top;
     295    }
     296
    213297    private void ExpandSlaveGroupNodes() {
    214298      foreach (TreeNode n in nodeStore.Where(x => x.Tag is SlaveGroup)) {
     
    219303    }
    220304
    221     private void ExtractStatistics(TreeNode treeNode = null) {
    222       //StringBuilder sb = new StringBuilder();
    223       //Resource resource = treeNode == null ? null : treeNode.Tag as Resource;
    224       //ISet<Resource> resources = treeNode == null ? selectedResources : new HashSet<Resource>(treeNode.DescendantNodes().Select(x => x.Tag as Resource)); ;
    225       //IEnumerable<SlaveGroup> slaveGroups = resources.OfType<SlaveGroup>();
    226       //IEnumerable<Slave> slaves = resources.OfType<Slave>();
    227       //int cpuSpeed = 0, cores = 0, freeCores = 0, memory = 0, freeMemory = 0;
    228       //string contextString = treeNode == null ? "Selected" : "Included";
    229 
    230       //if (resources.Any() || resource != null) {
    231       //  foreach (Slave s in slaves) {
    232       //    cpuSpeed += s.CpuSpeed.GetValueOrDefault();
    233       //    cores += s.Cores.GetValueOrDefault();
    234       //    freeCores += s.FreeCores.GetValueOrDefault();
    235       //    memory += s.Memory.GetValueOrDefault();
    236       //    freeMemory += s.FreeMemory.GetValueOrDefault();
    237       //  }
    238       //  if (resource != null) {
    239       //    if (resource is SlaveGroup) sb.Append("Slave group: ");
    240       //    else if (resource is Slave) {
    241       //      sb.Append("Slave: ");
    242       //      if (!resources.Any()) {
    243       //        Slave s = resource as Slave;
    244       //        cpuSpeed = s.CpuSpeed.GetValueOrDefault();
    245       //        cores = s.Cores.GetValueOrDefault();
    246       //        freeCores = s.FreeCores.GetValueOrDefault();
    247       //        memory = s.Memory.GetValueOrDefault();
    248       //        freeMemory = s.FreeMemory.GetValueOrDefault();
    249       //      }
    250       //    }
    251       //    sb.AppendLine(string.Format("{0}", resource.Name));
    252       //  }
    253       //  if (resource == null || resource is SlaveGroup) {
    254       //    if (resources.Any()) {
    255       //      sb.AppendFormat("{0} slave groups ({1}): ", contextString, slaveGroups.Count());
    256       //      foreach (SlaveGroup sg in slaveGroups) sb.AppendFormat("{0}; ", sg.Name);
    257       //      sb.AppendLine();
    258       //      sb.AppendFormat("{0} slaves ({1}): ", contextString, slaves.Count());
    259       //      foreach (Slave s in slaves) sb.AppendFormat("{0}; ", s.Name);
    260       //      sb.AppendLine();
    261       //    } else {
    262       //      sb.Append("The selection does not inlcude any further resources.");
    263       //    }
    264       //  }
    265       //  sb.AppendLine();
    266       //  sb.AppendLine(string.Format("CPU speed: {0} MHz", cpuSpeed));
    267       //  if (resources.Any()) sb.AppendLine(string.Format("Avg. CPU speed: {0:0.00} MHz", (double)cpuSpeed / resources.Count()));
    268       //  sb.AppendLine(string.Format("Cores: {0}", cores));
    269       //  sb.AppendLine(string.Format("Free cores: {0}", freeCores));
    270       //  if (resources.Any()) sb.AppendLine(string.Format("Avg. free cores: {0:0.00}", (double)freeCores / resources.Count()));
    271       //  sb.AppendLine(string.Format("Memory: {0} MB", memory));
    272       //  sb.AppendFormat("Free memory: {0} MB", freeMemory);
    273       //  if (resources.Any()) sb.Append(string.Format("{0}Avg. free memory: {1:0.00} MB", Environment.NewLine, (double)freeMemory / resources.Count()));
    274       //} else {
    275       //  sb.Append("No resources selected.");
    276       //}
    277 
    278       //descriptionTextBox.Text = sb.ToString();
     305    private void ExtractStatistics(Resource resource = null) {
     306      ISet<Slave> selectedSlaves = null;
     307
     308      if (resource != null) {
     309        var slaveGroup = resource as SlaveGroup;
     310        if (slaveGroup != null) {
     311          var children = new HashSet<Resource>(resources.Where(x => x.ParentResourceId == slaveGroup.Id));
     312          int nrOfChildren = children.Count;
     313          do {
     314            var newChildren = resources.Where(x => children.Any(y => y.Id == x.ParentResourceId));
     315            foreach (var newChild in newChildren)
     316              children.Add(newChild);
     317          } while (children.Count > nrOfChildren);
     318          selectedSlaves = new HashSet<Slave>(children.OfType<Slave>());
     319          selectedSlaves.IntersectWith(selectedResources.OfType<Slave>());
     320        } else {
     321          selectedSlaves = new HashSet<Slave>(new[] { resource as Slave });
     322        }
     323      } else {
     324        selectedSlaves = new HashSet<Slave>(selectedResources.OfType<Slave>());
     325      }
     326
     327      int sumCores = selectedSlaves.OfType<Slave>().Sum(x => x.Cores.GetValueOrDefault());
     328      int sumFreeCores = selectedSlaves.OfType<Slave>().Sum(x => x.FreeCores.GetValueOrDefault());
     329      double sumMemory = selectedSlaves.OfType<Slave>().Sum(x => x.Memory.GetValueOrDefault()) / 1024.0;
     330      double sumFreeMemory = selectedSlaves.OfType<Slave>().Sum(x => x.FreeMemory.GetValueOrDefault()) / 1024.0;
     331
     332      coresSummaryLabel.Text = $"{sumCores} Total ({sumFreeCores} Free / {sumCores - sumFreeCores} Used)";
     333      memorySummaryLabel.Text = $"{sumMemory:0.00} GB Total ({sumFreeMemory:0.00} GB Free / {(sumMemory - sumFreeMemory):0.00} GB Used)";
     334    }
     335    #endregion
     336
     337    #region Events
     338    public event EventHandler SelectedProjectChanged;
     339    private void OnSelectedProjectChanged() {
     340      SelectedProjectChanged?.Invoke(this, EventArgs.Empty);
     341    }
     342
     343    public event EventHandler SelectedResourcesChanged;
     344    private void OnSelectedResourcesChanged() {
     345      SelectedResourcesChanged?.Invoke(this, EventArgs.Empty);
     346    }
     347
     348    public event EventHandler ProjectsTreeViewDoubleClicked;
     349    private void OnProjectsTreeViewDoubleClicked() {
     350      ProjectsTreeViewDoubleClicked?.Invoke(this, EventArgs.Empty);
    279351    }
    280352    #endregion
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.Designer.cs

    r15401 r15412  
    9494      this.hiveResourceSelector.Name = "hiveResourceSelector";
    9595      this.hiveResourceSelector.ReadOnly = false;
     96      this.hiveResourceSelector.SelectedProject = null;
    9697      this.hiveResourceSelector.Size = new System.Drawing.Size(549, 591);
    9798      this.hiveResourceSelector.TabIndex = 0;
     99      this.hiveResourceSelector.SelectedProjectChanged += new System.EventHandler(this.hiveResourceSelector_SelectedProjectChanged);
     100      this.hiveResourceSelector.SelectedResourcesChanged += new System.EventHandler(this.hiveResourceSelector_SelectedResourcesChanged);
     101      this.hiveResourceSelector.ProjectsTreeViewDoubleClicked += new System.EventHandler(this.hiveResourceSelector_ProjectsTreeViewDoubleClicked);
    98102      //
    99103      // HiveResourceSelectorDialog
     
    114118      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
    115119      this.Text = "Select Project";
    116       this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.HiveResourceSelectorDialog_FormClosing);
    117120      this.Load += new System.EventHandler(this.HiveResourceSelectorDialog_Load);
    118121      this.ResumeLayout(false);
     
    124127    protected System.Windows.Forms.Button okButton;
    125128    protected System.Windows.Forms.Button cancelButton;
     129    protected System.Windows.Forms.Button refreshButton;
    126130    protected HiveProjectSelector hiveResourceSelector;
    127     protected System.Windows.Forms.Button refreshButton;
    128131  }
    129132}
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.cs

    r15401 r15412  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    23 using System.Threading.Tasks;
     24using System.ComponentModel;
     25using System.Linq;
    2426using System.Windows.Forms;
    25 using HeuristicLab.PluginInfrastructure;
     27using HeuristicLab.Clients.Hive.Views;
     28using HeuristicLab.MainForm;
    2629
    2730namespace HeuristicLab.Clients.Hive.JobManager.Views {
    2831  public partial class HiveResourceSelectorDialog : Form {
     32    private readonly object locker = new object();
     33    private bool updatingProjects = false;
     34
     35    public Project SelectedProject {
     36      get { return hiveResourceSelector.SelectedProject; }
     37    }
     38
     39    public IEnumerable<Resource> SelectedResources {
     40      get { return hiveResourceSelector.SelectedResources; }
     41    }
     42
    2943    public HiveResourceSelectorDialog() {
    3044      InitializeComponent();
    3145    }
    3246
    33     public ISet<Project> GetSelectedResources() { return hiveResourceSelector.SelectedResources; }
    34     public Project SelectedProject { get { return hiveResourceSelector.SelectedProject; } }
    35 
    36     private void HiveResourceSelectorDialog_Load(object sender, System.EventArgs e) {
    37       HiveAdminClient.Instance.Refreshed += new System.EventHandler(Instance_Refreshed);
    38       DownloadResources();
     47    #region Overrides
     48    protected override void OnLoad(EventArgs e) {
     49      HiveAdminClient.Instance.Refreshing += HiveAdminClient_Instance_Refreshing;
     50      HiveAdminClient.Instance.Refreshed += HiveAdminClient_Instance_Refreshed;
     51      base.OnLoad(e);
    3952    }
    4053
    41     private void HiveResourceSelectorDialog_FormClosing(object sender, FormClosingEventArgs e) {
    42       HiveAdminClient.Instance.Refreshed -= new System.EventHandler(Instance_Refreshed);
     54    protected override void OnClosing(CancelEventArgs e) {
     55      HiveAdminClient.Instance.Refreshed -= HiveAdminClient_Instance_Refreshed;
     56      HiveAdminClient.Instance.Refreshing -= HiveAdminClient_Instance_Refreshing;
     57      base.OnClosing(e);
     58    }
     59    #endregion
     60
     61    #region Event Handlers
     62    private void HiveAdminClient_Instance_Refreshing(object sender, EventArgs e) {
     63      if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveAdminClient_Instance_Refreshing, sender, e);
     64      else {
     65        var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>();
     66        mainForm.AddOperationProgressToView(this, "Refreshing ...");
     67        refreshButton.Enabled = false;
     68      }
    4369    }
    4470
    45     void Instance_Refreshed(object sender, System.EventArgs e) {
     71    private void HiveAdminClient_Instance_Refreshed(object sender, EventArgs e) {
     72      if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveAdminClient_Instance_Refreshed, sender, e);
     73      else {
     74        var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>();
     75        mainForm.RemoveOperationProgressFromView(this);
     76        refreshButton.Enabled = true;
     77      }
     78    }
     79
     80    private async void HiveResourceSelectorDialog_Load(object sender, EventArgs e) {
     81      lock (locker) {
     82        if (updatingProjects) return;
     83        updatingProjects = true;
     84      }
     85
     86      await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
     87        action: () => UpdateProjects(),
     88        finallyCallback: () => updatingProjects = false);
     89    }
     90
     91    private async void refreshButton_Click(object sender, EventArgs e) {
     92      lock (locker) {
     93        if (updatingProjects) return;
     94        updatingProjects = true;
     95      }
     96
     97      await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
     98        action: () => UpdateProjects(),
     99        finallyCallback: () => updatingProjects = false);
     100    }
     101
     102    private void hiveResourceSelector_SelectedProjectChanged(object sender, EventArgs e) {
     103      okButton.Enabled = hiveResourceSelector.SelectedProject != null;
     104    }
     105
     106    private void hiveResourceSelector_SelectedResourcesChanged(object sender, EventArgs e) {
     107      okButton.Enabled = hiveResourceSelector.SelectedResources.Any();
     108    }
     109
     110    private void hiveResourceSelector_ProjectsTreeViewDoubleClicked(object sender, EventArgs e) {
     111      if (hiveResourceSelector.SelectedProject == null) return;
     112
     113      DialogResult = DialogResult.OK;
     114      Close();
     115    }
     116    #endregion
     117
     118    #region Helpers
     119    private void UpdateProjects() {
     120      HiveAdminClient.Instance.Refresh();
    46121      hiveResourceSelector.Content = HiveAdminClient.Instance.Projects;
    47122    }
    48123
    49     private void refreshButton_Click(object sender, System.EventArgs e) {
    50       DownloadResources();
     124    private void ShowHiveInformationDialog() {
     125      if (InvokeRequired) Invoke((Action)ShowHiveInformationDialog);
     126      else {
     127        using (HiveInformationDialog dialog = new HiveInformationDialog()) {
     128          dialog.ShowDialog(this);
     129        }
     130      }
    51131    }
    52 
    53     private void DownloadResources() {
    54       var task = System.Threading.Tasks.Task.Factory.StartNew(DownloadResourcesAsync);
    55       task.ContinueWith(t => {
    56         hiveResourceSelector.FinishProgressView();
    57         ErrorHandling.ShowErrorDialog(this, "An error occurred while downloading the tasks.", t.Exception);
    58       }, TaskContinuationOptions.OnlyOnFaulted);
    59     }
    60 
    61     private void DownloadResourcesAsync() {
    62       hiveResourceSelector.StartProgressView();
    63       HiveAdminClient.Instance.Refresh();
    64       hiveResourceSelector.FinishProgressView();
    65     }
     132    #endregion
    66133  }
    67134}
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.Designer.cs

    r14901 r15412  
    5151      this.permissionTabPage = new System.Windows.Forms.TabPage();
    5252      this.refreshPermissionsButton = new System.Windows.Forms.Button();
    53       this.hiveExperimentPermissionListView = new HeuristicLab.Clients.Hive.JobManager.Views.HiveJobPermissionListView();
    5453      this.runsTabPage = new System.Windows.Forms.TabPage();
    5554      this.runCollectionViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     
    6362      this.executionTimeTextBox = new System.Windows.Forms.TextBox();
    6463      this.pauseButton = new System.Windows.Forms.Button();
    65       this.resourceIdsLabel = new System.Windows.Forms.Label();
    66       this.resourceNamesTextBox = new System.Windows.Forms.TextBox();
     64      this.projectLabel = new System.Windows.Forms.Label();
     65      this.projectNameTextBox = new System.Windows.Forms.TextBox();
    6766      this.nameLabel = new System.Windows.Forms.Label();
    6867      this.nameTextBox = new System.Windows.Forms.TextBox();
     
    7978      this.jobsLabel = new System.Windows.Forms.Label();
    8079      this.searchButton = new System.Windows.Forms.Button();
     80      this.hiveExperimentPermissionListView = new HeuristicLab.Clients.Hive.JobManager.Views.HiveJobPermissionListView();
    8181      this.tabControl.SuspendLayout();
    8282      this.tasksTabPage.SuspendLayout();
     
    9191      //
    9292      this.tabControl.AllowDrop = true;
    93       this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    94             | System.Windows.Forms.AnchorStyles.Left)
     93      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     94            | System.Windows.Forms.AnchorStyles.Left) 
    9595            | System.Windows.Forms.AnchorStyles.Right)));
    9696      this.tabControl.Controls.Add(this.tasksTabPage);
     
    119119      //
    120120      this.jobsTreeView.AllowDrop = true;
    121       this.jobsTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    122             | System.Windows.Forms.AnchorStyles.Left)
     121      this.jobsTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     122            | System.Windows.Forms.AnchorStyles.Left) 
    123123            | System.Windows.Forms.AnchorStyles.Right)));
    124124      this.jobsTreeView.Caption = "ItemTree View";
     
    155155      this.refreshPermissionsButton.Click += new System.EventHandler(this.refreshPermissionsButton_Click);
    156156      //
    157       // hiveExperimentPermissionListView
    158       //
    159       this.hiveExperimentPermissionListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    160             | System.Windows.Forms.AnchorStyles.Left)
    161             | System.Windows.Forms.AnchorStyles.Right)));
    162       this.hiveExperimentPermissionListView.Caption = "HiveExperimentPermissionList View";
    163       this.hiveExperimentPermissionListView.Content = null;
    164       this.hiveExperimentPermissionListView.HiveExperimentId = new System.Guid("00000000-0000-0000-0000-000000000000");
    165       this.hiveExperimentPermissionListView.Location = new System.Drawing.Point(3, 33);
    166       this.hiveExperimentPermissionListView.Name = "hiveExperimentPermissionListView";
    167       this.hiveExperimentPermissionListView.ReadOnly = false;
    168       this.hiveExperimentPermissionListView.ShowDetails = true;
    169       this.hiveExperimentPermissionListView.Size = new System.Drawing.Size(703, 390);
    170       this.hiveExperimentPermissionListView.TabIndex = 0;
    171       //
    172157      // runsTabPage
    173158      //
     
    183168      // runCollectionViewHost
    184169      //
    185       this.runCollectionViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    186             | System.Windows.Forms.AnchorStyles.Left)
     170      this.runCollectionViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     171            | System.Windows.Forms.AnchorStyles.Left) 
    187172            | System.Windows.Forms.AnchorStyles.Right)));
    188173      this.runCollectionViewHost.Caption = "View";
     
    209194      // stateLogViewHost
    210195      //
    211       this.stateLogViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    212             | System.Windows.Forms.AnchorStyles.Left)
     196      this.stateLogViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     197            | System.Windows.Forms.AnchorStyles.Left) 
    213198            | System.Windows.Forms.AnchorStyles.Right)));
    214199      this.stateLogViewHost.Caption = "StateLog View";
     
    235220      // logView
    236221      //
    237       this.logView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    238             | System.Windows.Forms.AnchorStyles.Left)
     222      this.logView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     223            | System.Windows.Forms.AnchorStyles.Left) 
    239224            | System.Windows.Forms.AnchorStyles.Right)));
    240225      this.logView.Caption = "Log View";
     
    302287      this.pauseButton.Click += new System.EventHandler(this.pauseButton_Click);
    303288      //
    304       // resourceIdsLabel
    305       //
    306       this.resourceIdsLabel.AutoSize = true;
    307       this.resourceIdsLabel.Location = new System.Drawing.Point(3, 56);
    308       this.resourceIdsLabel.Name = "resourceIdsLabel";
    309       this.resourceIdsLabel.Size = new System.Drawing.Size(61, 13);
    310       this.resourceIdsLabel.TabIndex = 12;
    311       this.resourceIdsLabel.Text = "Resources:";
    312       //
    313       // resourceNamesTextBox
    314       //
    315       this.resourceNamesTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    316             | System.Windows.Forms.AnchorStyles.Right)));
    317       this.resourceNamesTextBox.Location = new System.Drawing.Point(70, 52);
    318       this.resourceNamesTextBox.Name = "resourceNamesTextBox";
    319       this.resourceNamesTextBox.Size = new System.Drawing.Size(471, 20);
    320       this.resourceNamesTextBox.TabIndex = 2;
    321       this.resourceNamesTextBox.Validated += new System.EventHandler(this.resourceNamesTextBox_Validated);
     289      // projectLabel
     290      //
     291      this.projectLabel.AutoSize = true;
     292      this.projectLabel.Location = new System.Drawing.Point(3, 56);
     293      this.projectLabel.Name = "projectLabel";
     294      this.projectLabel.Size = new System.Drawing.Size(43, 13);
     295      this.projectLabel.TabIndex = 12;
     296      this.projectLabel.Text = "Project:";
     297      //
     298      // projectNameTextBox
     299      //
     300      this.projectNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     301            | System.Windows.Forms.AnchorStyles.Right)));
     302      this.projectNameTextBox.Location = new System.Drawing.Point(82, 52);
     303      this.projectNameTextBox.Name = "projectNameTextBox";
     304      this.projectNameTextBox.ReadOnly = true;
     305      this.projectNameTextBox.Size = new System.Drawing.Size(489, 20);
     306      this.projectNameTextBox.TabIndex = 2;
     307      this.projectNameTextBox.Validated += new System.EventHandler(this.resourceNamesTextBox_Validated);
    322308      //
    323309      // nameLabel
     
    332318      // nameTextBox
    333319      //
    334       this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    335             | System.Windows.Forms.AnchorStyles.Right)));
    336       this.nameTextBox.Location = new System.Drawing.Point(70, 27);
     320      this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     321            | System.Windows.Forms.AnchorStyles.Right)));
     322      this.nameTextBox.Location = new System.Drawing.Point(52, 27);
    337323      this.nameTextBox.Name = "nameTextBox";
    338       this.nameTextBox.Size = new System.Drawing.Size(501, 20);
     324      this.nameTextBox.Size = new System.Drawing.Size(519, 20);
    339325      this.nameTextBox.TabIndex = 1;
    340326      this.nameTextBox.Validated += new System.EventHandler(this.nameTextBox_Validated);
     
    391377      // finishedTextBox
    392378      //
    393       this.finishedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     379      this.finishedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    394380            | System.Windows.Forms.AnchorStyles.Right)));
    395381      this.finishedTextBox.Location = new System.Drawing.Point(74, 64);
     
    400386      // calculatingTextBox
    401387      //
    402       this.calculatingTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     388      this.calculatingTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    403389            | System.Windows.Forms.AnchorStyles.Right)));
    404390      this.calculatingTextBox.Location = new System.Drawing.Point(74, 40);
     
    409395      // jobsTextBox
    410396      //
    411       this.jobsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     397      this.jobsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    412398            | System.Windows.Forms.AnchorStyles.Right)));
    413399      this.jobsTextBox.Location = new System.Drawing.Point(74, 16);
     
    445431      // searchButton
    446432      //
    447       this.searchButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    448433      this.searchButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Zoom;
    449       this.searchButton.Location = new System.Drawing.Point(547, 50);
     434      this.searchButton.Location = new System.Drawing.Point(52, 50);
    450435      this.searchButton.Name = "searchButton";
    451436      this.searchButton.Size = new System.Drawing.Size(24, 24);
     
    453438      this.searchButton.UseVisualStyleBackColor = true;
    454439      this.searchButton.Click += new System.EventHandler(this.searchButton_Click);
     440      //
     441      // hiveExperimentPermissionListView
     442      //
     443      this.hiveExperimentPermissionListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     444            | System.Windows.Forms.AnchorStyles.Left)
     445            | System.Windows.Forms.AnchorStyles.Right)));
     446      this.hiveExperimentPermissionListView.Caption = "HiveExperimentPermissionList View";
     447      this.hiveExperimentPermissionListView.Content = null;
     448      this.hiveExperimentPermissionListView.HiveExperimentId = new System.Guid("00000000-0000-0000-0000-000000000000");
     449      this.hiveExperimentPermissionListView.Location = new System.Drawing.Point(3, 33);
     450      this.hiveExperimentPermissionListView.Name = "hiveExperimentPermissionListView";
     451      this.hiveExperimentPermissionListView.ReadOnly = false;
     452      this.hiveExperimentPermissionListView.ShowDetails = true;
     453      this.hiveExperimentPermissionListView.Size = new System.Drawing.Size(703, 390);
     454      this.hiveExperimentPermissionListView.TabIndex = 0;
    455455      //
    456456      // RefreshableHiveJobView
     
    468468      this.Controls.Add(this.executionTimeTextBox);
    469469      this.Controls.Add(this.executionTimeLabel);
    470       this.Controls.Add(this.resourceNamesTextBox);
     470      this.Controls.Add(this.projectNameTextBox);
    471471      this.Controls.Add(this.pauseButton);
    472       this.Controls.Add(this.resourceIdsLabel);
     472      this.Controls.Add(this.projectLabel);
    473473      this.Controls.Add(this.stopButton);
    474474      this.Name = "RefreshableHiveJobView";
     
    493493    private System.Windows.Forms.TextBox executionTimeTextBox;
    494494    private System.Windows.Forms.Button pauseButton;
    495     private System.Windows.Forms.Label resourceIdsLabel;
    496     private System.Windows.Forms.TextBox resourceNamesTextBox;
     495    private System.Windows.Forms.Label projectLabel;
     496    private System.Windows.Forms.TextBox projectNameTextBox;
    497497    private System.Windows.Forms.TabPage logTabPage;
    498498    private Core.Views.LogView logView;
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r15401 r15412  
    2323using System.ComponentModel;
    2424using System.Linq;
    25 using System.Text;
    2625using System.Threading;
    2726using System.Threading.Tasks;
     
    118117          nameTextBox.Text = string.Empty;
    119118          executionTimeTextBox.Text = string.Empty;
    120           resourceNamesTextBox.Text = string.Empty;
     119          projectNameTextBox.Text = string.Empty;
    121120          refreshAutomaticallyCheckBox.Checked = false;
    122121          lock (runCollectionViewLocker) {
     
    137136          }
    138137        }
    139       }
    140       finally {
     138      } finally {
    141139        SuppressEvents = false;
    142140      }
     
    158156      tabControl.Enabled = !Locked;
    159157      nameTextBox.Enabled = !Locked;
    160       resourceNamesTextBox.Enabled = !Locked;
     158      projectNameTextBox.Enabled = !Locked;
    161159      searchButton.Enabled = !Locked;
    162160      jobsTreeView.Enabled = !Locked;
     
    183181
    184182          this.nameTextBox.ReadOnly = !Content.IsControllable || Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded || Content.IsProgressing;
    185           this.resourceNamesTextBox.ReadOnly = !Content.IsControllable || Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded || Content.IsProgressing;
    186183          this.searchButton.Enabled = Content.IsControllable && Content.ExecutionState == ExecutionState.Prepared && !alreadyUploaded && !Content.IsProgressing;
    187184          this.jobsTreeView.ReadOnly = !Content.IsControllable || Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded || Content.IsProgressing;
     
    335332      if (hiveResourceSelectorDialog == null)
    336333        hiveResourceSelectorDialog = new HiveResourceSelectorDialog();
     334
    337335      if (hiveResourceSelectorDialog.ShowDialog(this) == DialogResult.OK) {
    338         StringBuilder sb = new StringBuilder();
    339         //foreach (Project resource in hiveResourceSelectorDialog.GetSelectedResources()) {
    340         //  sb.Append(resource.Name);
    341         //  sb.Append(";");
    342         //}
    343         //resourceNamesTextBox.Text = sb.ToString();
    344         //if (Content.Job.ResourceNames != resourceNamesTextBox.Text)
    345         //  Content.Job.ResourceNames = resourceNamesTextBox.Text;
    346336        var selectedProject = hiveResourceSelectorDialog.SelectedProject;
    347         resourceNamesTextBox.Text = selectedProject.Name;
    348         if (Content.Job.ProjectId != selectedProject.Id)
    349           Content.Job.ProjectId = selectedProject.Id;
     337        projectNameTextBox.Text = selectedProject.Name;
     338        Content.Job.ProjectId = selectedProject.Id;
     339        Content.Job.ResourceIds = hiveResourceSelectorDialog.SelectedResources.Select(x => x.Id).ToList();
    350340      }
    351341    }
     
    421411        try {
    422412          invoker.EndInvoke(ar);
    423         }
    424         catch (Exception ex) {
    425           ThreadPool.QueueUserWorkItem(delegate(object exception) { ErrorHandling.ShowErrorDialog(this, (Exception)exception); }, ex);
     413        } catch (Exception ex) {
     414          ThreadPool.QueueUserWorkItem(delegate (object exception) { ErrorHandling.ShowErrorDialog(this, (Exception)exception); }, ex);
    426415        }
    427416      }, null);
     
    510499          if (subTask is OptimizerHiveTask) {
    511500            OptimizerHiveTask ohTask = subTask as OptimizerHiveTask;
    512             ohTask.ExecuteReadActionOnItemTask(new Action(delegate() {
     501            ohTask.ExecuteReadActionOnItemTask(new Action(delegate () {
    513502              runs.AddRange(ohTask.ItemTask.Item.Runs);
    514503            }));
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/HiveClient.cs

    r15401 r15412  
    255255        refreshableJob.IsProgressing = true;
    256256        refreshableJob.Progress.Start("Connecting to server...");
    257         IEnumerable<string> resourceNames = ToResourceNameList("");
    258         var resourceIds = new List<Guid>();
    259         foreach (var resourceName in resourceNames) {
    260           Guid resourceId = HiveServiceLocator.Instance.CallHiveService((s) => s.GetResourceId(resourceName));
    261           if (resourceId == Guid.Empty) {
    262             throw new ResourceNotFoundException(string.Format("Could not find the resource '{0}'", resourceName));
    263           }
    264           resourceIds.Add(resourceId);
    265         }
    266257
    267258        foreach (OptimizerHiveTask hiveJob in refreshableJob.HiveTasks.OfType<OptimizerHiveTask>()) {
     
    293284        foreach (HiveTask hiveTask in refreshableJob.HiveTasks) {
    294285          var task = TS.Task.Factory.StartNew((hj) => {
    295             UploadTaskWithChildren(refreshableJob.Progress, (HiveTask)hj, null, resourceIds, jobCount, totalJobCount, configFilePlugin.Id, refreshableJob.Job.Id, refreshableJob.Log, cancellationToken);
     286            UploadTaskWithChildren(refreshableJob.Progress, (HiveTask)hj, null, refreshableJob.Job.ResourceIds, jobCount, totalJobCount, configFilePlugin.Id, refreshableJob.Job.Id, refreshableJob.Log, cancellationToken);
    296287          }, hiveTask);
    297288          task.ContinueWith((x) => refreshableJob.Log.LogException(x.Exception), TaskContinuationOptions.OnlyOnFaulted);
     
    377368              hiveTask.Task.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddChildTask(parentHiveTask.Task.Id, hiveTask.Task, taskData));
    378369            } else {
    379               hiveTask.Task.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddTask(hiveTask.Task, taskData));
     370              hiveTask.Task.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddTask(hiveTask.Task, taskData, groups.ToList()));
    380371            }
    381372          }
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/ServiceClients/HiveServiceClient.cs

    r15401 r15412  
    3030    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.PluginData))]
    3131    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.ProjectPermission))]
     32    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.AssignedProjectResource))]
    3233    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Downtime))]
    3334    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.UserPriority))]
     
    11661167                    this.ProjectIdField = value;
    11671168                    this.RaisePropertyChanged("ProjectId");
     1169                }
     1170            }
     1171        }
     1172    }
     1173   
     1174    [System.Diagnostics.DebuggerStepThroughAttribute()]
     1175    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
     1176    [System.Runtime.Serialization.DataContractAttribute(Name="AssignedProjectResource", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")]
     1177    [System.SerializableAttribute()]
     1178    public partial class AssignedProjectResource : HeuristicLab.Clients.Hive.HiveItem
     1179    {
     1180       
     1181        [System.Runtime.Serialization.OptionalFieldAttribute()]
     1182        private System.Guid ProjectIdField;
     1183       
     1184        [System.Runtime.Serialization.OptionalFieldAttribute()]
     1185        private System.Guid ResourceIdField;
     1186       
     1187        [System.Runtime.Serialization.DataMemberAttribute()]
     1188        public System.Guid ProjectId
     1189        {
     1190            get
     1191            {
     1192                return this.ProjectIdField;
     1193            }
     1194            set
     1195            {
     1196                if ((this.ProjectIdField.Equals(value) != true))
     1197                {
     1198                    this.ProjectIdField = value;
     1199                    this.RaisePropertyChanged("ProjectId");
     1200                }
     1201            }
     1202        }
     1203       
     1204        [System.Runtime.Serialization.DataMemberAttribute()]
     1205        public System.Guid ResourceId
     1206        {
     1207            get
     1208            {
     1209                return this.ResourceIdField;
     1210            }
     1211            set
     1212            {
     1213                if ((this.ResourceIdField.Equals(value) != true))
     1214                {
     1215                    this.ResourceIdField = value;
     1216                    this.RaisePropertyChanged("ResourceId");
    11681217                }
    11691218            }
     
    22102259       
    22112260        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AddTask", ReplyAction="http://tempuri.org/IHiveService/AddTaskResponse")]
    2212         System.Guid AddTask(HeuristicLab.Clients.Hive.Task task, HeuristicLab.Clients.Hive.TaskData taskData);
     2261        System.Guid AddTask(HeuristicLab.Clients.Hive.Task task, HeuristicLab.Clients.Hive.TaskData taskData, System.Collections.Generic.List<System.Guid> resourceIds);
    22132262       
    22142263        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AddChildTask", ReplyAction="http://tempuri.org/IHiveService/AddChildTaskResponse")]
     
    23182367        System.Collections.Generic.List<HeuristicLab.Clients.Hive.ProjectPermission> GetProjectPermissions(System.Guid projectId);
    23192368       
     2369        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AssignProjectResources", ReplyAction="http://tempuri.org/IHiveService/AssignProjectResourcesResponse")]
     2370        void AssignProjectResources(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds);
     2371       
     2372        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/UnassignProjectResources", ReplyAction="http://tempuri.org/IHiveService/UnassignProjectResourcesResponse")]
     2373        void UnassignProjectResources(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds);
     2374       
     2375        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetAssignedResourcesForProject", ReplyAction="http://tempuri.org/IHiveService/GetAssignedResourcesForProjectResponse")]
     2376        System.Collections.Generic.List<HeuristicLab.Clients.Hive.AssignedProjectResource> GetAssignedResourcesForProject(System.Guid projectId);
     2377       
    23202378        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AddSlave", ReplyAction="http://tempuri.org/IHiveService/AddSlaveResponse")]
    23212379        System.Guid AddSlave(HeuristicLab.Clients.Hive.Slave slave);
     
    24162474        }
    24172475       
    2418         public System.Guid AddTask(HeuristicLab.Clients.Hive.Task task, HeuristicLab.Clients.Hive.TaskData taskData)
    2419         {
    2420             return base.Channel.AddTask(task, taskData);
     2476        public System.Guid AddTask(HeuristicLab.Clients.Hive.Task task, HeuristicLab.Clients.Hive.TaskData taskData, System.Collections.Generic.List<System.Guid> resourceIds)
     2477        {
     2478            return base.Channel.AddTask(task, taskData, resourceIds);
    24212479        }
    24222480       
     
    25962654        }
    25972655       
     2656        public void AssignProjectResources(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds)
     2657        {
     2658            base.Channel.AssignProjectResources(projectId, resourceIds);
     2659        }
     2660       
     2661        public void UnassignProjectResources(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds)
     2662        {
     2663            base.Channel.UnassignProjectResources(projectId, resourceIds);
     2664        }
     2665       
     2666        public System.Collections.Generic.List<HeuristicLab.Clients.Hive.AssignedProjectResource> GetAssignedResourcesForProject(System.Guid projectId)
     2667        {
     2668            return base.Channel.GetAssignedResourcesForProject(projectId);
     2669        }
     2670       
    25982671        public System.Guid AddSlave(HeuristicLab.Clients.Hive.Slave slave)
    25992672        {
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/ServiceClients/Job.cs

    r15401 r15412  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.ComponentModel;
    2425using HeuristicLab.Common;
     
    2627namespace HeuristicLab.Clients.Hive {
    2728  public partial class Job : IDeepCloneable, IContent {
     29    public List<Guid> ResourceIds { get; set; }
    2830
    2931    #region Constructors and Cloning
     
    4345      this.Id = original.Id;
    4446      this.Permission = original.Permission;
     47      this.ResourceIds = original.ResourceIds;
    4548    }
    4649    public override IDeepCloneable Clone(Cloner cloner) {
Note: See TracChangeset for help on using the changeset viewer.