void clientLogic_ClientLogicUI(object sender, ClientLogicUIEventArgs e) { if (this.Dispatcher.CheckAccess()) { if (e.UIRequest == ClientLogicUIRequest.EventPackageRefreshComplete) { listViewEvents.Items.Refresh(); } else if (e.UIRequest == ClientLogicUIRequest.EventPackageListReady) { UpdateState(); // if we just sorted then apply the relevant adorner if ((_lastSortColumn != null) && (_nextSortAdorner != null)) { AdornerLayer.GetAdornerLayer(_lastSortColumn).Add(_nextSortAdorner); _lastSortAdorner = _nextSortAdorner; _nextSortAdorner = null; } } } else { this.Dispatcher.BeginInvoke(new Action <object, ClientLogicUIEventArgs>(clientLogic_ClientLogicUI), sender, e); } }
void _clientLogic_ClientLogicUI(object sender, ClientLogicUIEventArgs e) { if (this.Dispatcher.CheckAccess()) { if (_windowClosed) { return; } if (e.UIRequest == ClientLogicUIRequest.ScriptReady) { switch (_actionOnScriptReady) { case ActionOnScriptReady.Edit: DoEdit(); break; case ActionOnScriptReady.Delete: DoDelete(); break; } } else if (e.UIRequest == ClientLogicUIRequest.ScriptResultsReady) { ShowTestScriptResults(); } UpdateState(); } else { this.Dispatcher.BeginInvoke(new Action <object, ClientLogicUIEventArgs>(_clientLogic_ClientLogicUI), sender, e); } }
void clientLogic_ClientLogicUI(object sender, ClientLogicUIEventArgs e) { if (this.Dispatcher.CheckAccess()) { ClientLogic clientLogic = this.DataContext as ClientLogic; Debug.Assert(clientLogic != null); switch (e.UIRequest) { case ClientLogicUIRequest.EventPackageRefreshComplete: listViewCabs.Items.Refresh(); listViewEventInfos.Items.Refresh(); clientLogic.GetEventNotes(); break; case ClientLogicUIRequest.EventNotesReady: // if we have some notes display them if (clientLogic.CurrentEventNotes != null) { notesControl.UpdateNotes(clientLogic.CurrentEventNotes); } else { notesControl.ClearNotes(); } break; } } else { this.Dispatcher.BeginInvoke(new Action <object, ClientLogicUIEventArgs>(clientLogic_ClientLogicUI), sender, e); } }
void _clientLogic_ClientLogicUI(object sender, ClientLogicUIEventArgs e) { if (e.UIRequest == ClientLogicUIRequest.ContextCollectionReady) { this.Dispatcher.BeginInvoke(new Action(UpdateActiveContexts)); } }
void _clientLogic_ClientLogicUI(object sender, ClientLogicUIEventArgs e) { if (this.Dispatcher.CheckAccess()) { if (e.UIRequest == ClientLogicUIRequest.ProductPropertiesUpdated) { this.DialogResult = true; } } else { this.Dispatcher.BeginInvoke(new Action <object, ClientLogicUIEventArgs>(_clientLogic_ClientLogicUI), sender, e); } }
void _clientLogic_ClientLogicUI(object sender, ClientLogicUIEventArgs e) { if (this.Dispatcher.CheckAccess()) { // only display result if this page initiated a request if ((e.UIRequest == ClientLogicUIRequest.ScriptResultsReady) && ((_scriptRunFromPage) || (_clientLogic.CurrentView == ClientLogicView.CabDetail))) { _scriptRunFromPage = false; DisplayScriptResult resultFile = listViewResultFiles.SelectedItem as DisplayScriptResult; if ((resultFile != null) && (_clientLogic.CurrentScriptResult != null)) { if (_clientLogic.CurrentScriptResult.Name == resultFile.ScriptName) { richTextBoxScriptResult.Document.Blocks.Clear(); richTextBoxScriptResult.Document.Blocks.Add(ScriptResultViewer.GetScriptResultParagraph(_clientLogic.CurrentScriptResult)); } } // begin invoke to give ClientLogic a chance to free up this.Dispatcher.BeginInvoke(new Action(DoGetCabNotes)); } else if (e.UIRequest == ClientLogicUIRequest.CabNotesReady) { // if we have some notes update them if (_clientLogic.CurrentCabNotes != null) { notesControl.UpdateNotes(_clientLogic.CurrentCabNotes); } else { notesControl.ClearNotes(); } } else if (e.UIRequest == ClientLogicUIRequest.CabFileReady) { richTextBoxScriptResult.Document.Blocks.Clear(); if (_clientLogic.CurrentCabFileContents != null) { richTextBoxScriptResult.Document.Blocks.Add(new Paragraph(new Run(_clientLogic.CurrentCabFileContents))); } } } else { this.Dispatcher.BeginInvoke(new Action <object, ClientLogicUIEventArgs>(_clientLogic_ClientLogicUI), sender, e); } }
void _clientLogic_ClientLogicUI(object sender, ClientLogicUIEventArgs e) { if (this.Dispatcher.CheckAccess()) { if (e.UIRequest == ClientLogicUIRequest.TestIndexCreated) { // close window if test index created DialogResult = true; Close(); } } else { this.Dispatcher.BeginInvoke(new Action <object, ClientLogicUIEventArgs>(_clientLogic_ClientLogicUI), sender, e); } }
void clientLogic_ClientLogicUI(object sender, ClientLogicUIEventArgs e) { if (this.Dispatcher.CheckAccess()) { if (e.UIRequest == ClientLogicUIRequest.ProductSummaryUpdated) { TryUpdateCharts(); } else if (e.UIRequest == ClientLogicUIRequest.ProductsUpdated) { ClientLogic clientLogic = this.DataContext as ClientLogic; if (_productListHookupRequested) { listViewProducts.ItemsSource = clientLogic.Products; _productListHookupRequested = false; } listViewProducts.Items.Refresh(); if (!clientLogic.AnyEnabledProducts) { // no enabled products, show disabled ones RaiseShowDisabledProducts(); } // begin invoke to free up client logic this.Dispatcher.BeginInvoke(new Action(DoSelectionChanged)); } else if (e.UIRequest == ClientLogicUIRequest.ProductListCleared) { listViewProducts.ItemsSource = null; listViewProducts.Items.Refresh(); _productListHookupRequested = true; } } else { this.Dispatcher.BeginInvoke(new Action <object, ClientLogicUIEventArgs>(clientLogic_ClientLogicUI), sender, e); } }
void _clientLogic_ClientLogicUI(object sender, ClientLogicUIEventArgs e) { if (this.Dispatcher.CheckAccess()) { switch (e.UIRequest) { case ClientLogicUIRequest.ContextCollectionReady: UpdateXmlSettings(); break; case ClientLogicUIRequest.MoveIndexComplete: // update contexts - BeginInvoke to free up ClientLogic this.Dispatcher.BeginInvoke(new Action(UpdateContextSettings)); break; } } else { this.Dispatcher.BeginInvoke(new Action <object, ClientLogicUIEventArgs>(_clientLogic_ClientLogicUI), sender, e); } }
void _clientLogic_ClientLogicUI(object sender, ClientLogicUIEventArgs e) { if (this.Dispatcher.CheckAccess()) { // reset expected action _currentExpectedAction = ExpectedAction.None; switch (e.UIRequest) { case ClientLogicUIRequest.ProxySettingsUpdated: // before closing try to reselect the active context Id on load if (UserSettings.Settings.CurrentContextId != _activeContextIdOnLoad) { if ((_clientLogic.ContextCollection != null) && (_clientLogic.ContextCollection.Count > 0)) { foreach (DisplayContext contextSettings in _clientLogic.ContextCollection) { if ((contextSettings.IsActive) && (contextSettings.Id == _activeContextIdOnLoad)) { UserSettings.Settings.CurrentContextId = contextSettings.Id; break; } } } } // proxy settings updated on exit so close when complete this.DialogResult = true; break; case ClientLogicUIRequest.ContextCollectionReady: UpdateState(); UpdateProyControl(); _updatingLogAndReportingStatus = true; _updatingProfileStatus = true; checkBoxServiceLog.IsChecked = _clientLogic.ServiceLogEnabled; listViewProfiles.Items.Refresh(); _updatingProfileStatus = false; _updatingLogAndReportingStatus = false; if (_activateRequired) { _activateRequired = false; _clientLogic.AdminActivateContext(_activateContextId); } break; case ClientLogicUIRequest.NewContextSettingsReady: // get DB settings for the add operation - BeginInvoke to free up ClientLogic this.Dispatcher.BeginInvoke(new Action(RunDBConfigForAdd)); break; case ClientLogicUIRequest.MoveIndexComplete: // update contexts - BeginInvoke to free up ClientLogic this.Dispatcher.BeginInvoke(new Action(UpdateContextSettings)); break; } } else { this.Dispatcher.BeginInvoke(new Action <object, ClientLogicUIEventArgs>(_clientLogic_ClientLogicUI), sender, e); } }