Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/04/12 16:45:02 (12 years ago)
Author:
spimming
Message:

#1680:

  • merged changes from trunk into branch
Location:
branches/HeuristicLab.Hive.Azure
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive.Azure

  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.Administrator/3.3

    • Property svn:ignore
      •  

        old new  
        11Plugin.cs
        22obj
         3*.vs10x
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs

    r7215 r7270  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    5151    public ResourcesView() {
    5252      InitializeComponent();
    53       treeSlaveGroup.ImageList.Images.Add(HiveImageLibrary.Slave);
    54       treeSlaveGroup.ImageList.Images.Add(HiveImageLibrary.SlaveGroup);
     53      treeSlaveGroup.ImageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.MonitorLarge);
     54      treeSlaveGroup.ImageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.NetworkCenterLarge);
    5555
    5656      HiveAdminClient.Instance.Refreshing += new EventHandler(Instance_Refreshing);
     
    170170    protected override void SetEnabledStateOfControls() {
    171171      base.SetEnabledStateOfControls();
     172      if (Content == null) {
     173        btnAddGroup.Enabled = false;
     174        btnRemoveGroup.Enabled = false;
     175        btnSave.Enabled = false;
     176      } else {
     177        btnAddGroup.Enabled = true;
     178        btnRemoveGroup.Enabled = true;
     179        btnSave.Enabled = true;
     180      }
    172181    }
    173182
     
    337346
    338347    void ResetView() {
    339       treeSlaveGroup.Nodes.Clear();
    340 
    341       if (slaveView.Content != null && slaveView.Content is SlaveGroup) {
    342         slaveView.Content.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged);
    343       }
    344       slaveView.Content = null;
    345       if (scheduleView.Content != null) {
    346         scheduleView.Content.Clear();
    347       }
    348       HiveAdminClient.Instance.ResetDowntime();
     348      if (this.InvokeRequired) {
     349        Invoke(new Action(ResetView));
     350      } else {
     351        treeSlaveGroup.Nodes.Clear();
     352
     353        if (slaveView.Content != null && slaveView.Content is SlaveGroup) {
     354          slaveView.Content.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged);
     355        }
     356        slaveView.Content = null;
     357        if (scheduleView.Content != null) {
     358          scheduleView.Content.Clear();
     359        }
     360        HiveAdminClient.Instance.ResetDowntime();
     361      }
    349362    }
    350363
    351364    private void UpdateResources() {
    352       if (this.InvokeRequired) {
    353         this.Invoke(new Action(ResetView));
    354       } else {
    355         ResetView();
    356       }
     365      ResetView();
    357366
    358367      try {
     
    361370      }
    362371      catch (MessageSecurityException) {
     372        ShowMessageSecurityException();
     373      }
     374      catch (AnonymousUserException) {
     375        ShowHiveInformationDialog();
     376      }
     377    }
     378
     379    private void ShowMessageSecurityException() {
     380      if (this.InvokeRequired) {
     381        Invoke(new Action(ShowMessageSecurityException));
     382      } else {
    363383        MessageBox.Show("A Message Security error has occured. This normally means that your user name or password is wrong.", "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error);
     384      }
     385    }
     386
     387    private void ShowHiveInformationDialog() {
     388      if (this.InvokeRequired) {
     389        Invoke(new Action(ShowHiveInformationDialog));
     390      } else {
     391        using (HiveInformationDialog dialog = new HiveInformationDialog()) {
     392          dialog.ShowDialog(this);
     393        }
    364394      }
    365395    }
Note: See TracChangeset for help on using the changeset viewer.