diff --git a/ENI2/Controls/ServerStatusControl.xaml.cs b/ENI2/Controls/ServerStatusControl.xaml.cs index c3ddd1e9..94a92bca 100644 --- a/ENI2/Controls/ServerStatusControl.xaml.cs +++ b/ENI2/Controls/ServerStatusControl.xaml.cs @@ -27,6 +27,7 @@ namespace ENI2.Controls private readonly static ILog _log = LogManager.GetLogger("ServerStatus"); private ProgressBar _updateProgressBar; private TextBlock _updateTextBlock; + private bool _isUpdating = false; public ServerStatusControl() { @@ -37,12 +38,14 @@ namespace ENI2.Controls } private void ServerStatusControl_Loaded(object sender, System.Windows.RoutedEventArgs e) - { + { this.refreshButton_Click(null, null); } internal void Update(LockingServiceReference.ServerStatus serverStatus) { + if (this._isUpdating) return; + _isUpdating = true; int totalNum = serverStatus.IMPFiles.Length + serverStatus.READYFiles.Length + serverStatus.CORRUPTFiles.Length; entries.Clear(); BackgroundWorker bgWorker = new BackgroundWorker(); @@ -93,10 +96,10 @@ namespace ENI2.Controls tmpList.Sort(); - System.Windows.Application.Current.Dispatcher.Invoke(delegate { + //System.Windows.Application.Current.Dispatcher.Invoke(delegate { foreach (StatusEntry se in tmpList) - entries.Add(se); - }); + entries.Add(se); + //}); }; bgWorker.RunWorkerCompleted += (o, e) => @@ -113,6 +116,8 @@ namespace ENI2.Controls this.labelStatusTransmitter.Content = transmitter.ToString(); this.busyIndicator.IsBusy = false; + + _isUpdating = false; }; this.busyIndicator.IsBusy = true;