Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/06/11 14:30:47 (12 years ago)
Author:
ascheibe
Message:

#1672 some fixes for the slave tray ui:

  • removed some more magic numbers
  • fixed reconnecting to windows service when it was stopped
  • added more time for stopping/starting windows service so that no exception is thrown because of a timeout
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive.Slave.Views/3.3/SlaveMainViewBase.cs

    r6983 r7135  
    6262    protected override void DeregisterContentEvents() {
    6363      Content.CoreConnectionChanged -= new EventHandler<Common.EventArgs<CoreConnection>>(Content_CoreConnectionChanged);
     64      Content.SlaveDisplayStateChanged -= new EventHandler<Common.EventArgs<SlaveDisplayStat>>(Content_SlaveDisplayStateChanged);
    6465      base.DeregisterContentEvents();
    6566    }
     
    6869      base.RegisterContentEvents();
    6970      Content.CoreConnectionChanged += new EventHandler<Common.EventArgs<CoreConnection>>(Content_CoreConnectionChanged);
     71      Content.SlaveDisplayStateChanged += new EventHandler<Common.EventArgs<SlaveDisplayStat>>(Content_SlaveDisplayStateChanged);
     72    }
     73
     74    void Content_SlaveDisplayStateChanged(object sender, Common.EventArgs<SlaveDisplayStat> e) {
     75      if (e.Value == SlaveDisplayStat.NoService) {
     76        Task.Factory.StartNew(Connector);
     77      }
    7078    }
    7179
    7280    void Content_CoreConnectionChanged(object sender, Common.EventArgs<CoreConnection> e) {
    7381      if (e.Value == CoreConnection.Offline) {
    74         Connector();
     82        Task.Factory.StartNew(Connector);
    7583      }
    7684    }
     
    119127
    120128        if (!connected) {
    121           Thread.Sleep(1000);
     129          Thread.Sleep(Settings.Default.ServiceReconnectTimeout);
    122130        }
    123131      }
Note: See TracChangeset for help on using the changeset viewer.