void loadSuperSession() { ViewModelProjectManager dc = DataContext as ViewModelProjectManager; if (dc == null || dc.ActiveStudy == null || superSessionStrip.SelectedSuperSession == null) { return; } if (!dc.ActiveStudy.IsSelectedSuperSessionOpened()) { Dispatcher.BeginInvoke(new Action(() => { try { ViewModelImagingSuperSession selected = superSessionStrip.SelectedSuperSession as ViewModelImagingSuperSession; if ((dc.ActiveStudy.OpenedSelectedSuperSession as ViewModelImagingSuperSession)?.VerifySavingOfDataModelChanges(true) ?? true) { dc.ActiveStudy.SelectedSuperSession = selected; dc.ActiveStudy.LoadSelectedSuperSession(); } } catch (Exception ex) { ViewMSOTcSystem.LogMessage(Xvue.MSOT.Services.Log.EnumLogType.Warning, "Selected SuperSession load", ex.Message); } })); } else if (dc.ActiveStudy.SelectedSuperSession == null) { Window parentWindow = Window.GetWindow(this); dc.MSOTService.NotifyUserOnAction("Select a visualization to load", parentWindow.Title, UserNotificationType.Warning, false); } }
private void mainGrid_SizeChanged(object sender, SizeChangedEventArgs e) { try { SetCurrentValue(MainImageAreaMaxWidthProperty, (sender as FrameworkElement).ActualWidth - (imageSizeSlider.ActualWidth + 35)); } catch (Exception ex) { ViewMSOTcSystem.LogMessage(Xvue.MSOT.Services.Log.EnumLogType.Warning, "ViewImagingSessionGenericFull", "Exception setting MainImageAreaMaxWidthProperty: " + ex.Message); } }
internal void HandlePreviewKeyDown(object sender, KeyEventArgs e) { if (_model == null) { return; } if (!_model.MSOTHardware.IsHWModuleLoaded) { return; } try { if (e.Key == Key.Return) { //Use refrection to get IxExtendedKey //For Numpad Enter Key, IsExtendedKey = True //For Main Keyboard Enter Key, IsExtendedKey = False bool isExtended = (bool)typeof(KeyEventArgs).InvokeMember("IsExtendedKey", System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, e, null); if (!isExtended) { return; } } ViewMSOTcSystem.LogMessage(Xvue.MSOT.Services.Log.EnumLogType.Info, "ViewOAM:HandlePreviewKeyDown", "Key: " + e.Key + ", SystemKey: " + e.SystemKey); KeyboardShortcutDelegate command; Key incomingKey; if (e.Key == Key.System) { incomingKey = e.SystemKey; } else { incomingKey = e.Key; } if (System.Windows.Forms.Control.IsKeyLocked(System.Windows.Forms.Keys.NumLock)) //show num lock status somewhere? { if (_keyBindings.TryGetValue(incomingKey, out command)) { command(); e.Handled = true; } } } catch (Exception ex) { ViewMSOTcSystem.LogMessage(Xvue.MSOT.Services.Log.EnumLogType.Warning, "ViewOAM", "Exception executing shortcut:" + ex.Message); } }
private void HandleClickInsideImagePropertiesMenus() { try { ViewRulerControlToggleButtonBase activeRuler = imagePropertiesMenuOAMControl.rulerDrawingToggleButton as ViewRulerControlToggleButtonBase; if (!activeRuler.IsMouseOver && activeRuler.IsChecked) { activeRuler.CancelRulerDrawing(); } } catch (Exception ex) { ViewMSOTcSystem.LogMessage(Xvue.MSOT.Services.Log.EnumLogType.Critical, "Exception inside ViewOAM.HandleClickInsideImagePropertiesMenus()", ex.Message); } }
private void HandleClickInsideImagePropertiesMenus() { try { ViewRulerControlToggleButtonBase activeRuler = ((SuperSessionViewingLayout)ComparisonViewingLayout == SuperSessionViewingLayout.Layout1 ? (imagePropertiesMenus.ActiveSessionMenus as ViewImagePropertiesGridMenus).rulerToggleButton as ViewRulerControlToggleButtonBase : (imagePropertiesMenus.ActiveSessionMenus as ViewImagePropertiesGridComparisonMenus).rulerToggleButton as ViewRulerControlToggleButtonBase); if (!activeRuler.IsMouseOver && activeRuler.IsChecked) { activeRuler.CancelRulerDrawing(); } } catch (Exception ex) { ViewMSOTcSystem.LogMessage(Xvue.MSOT.Services.Log.EnumLogType.Warning, "ViewImagingSuperSessionsGrid.HandleClickInsideImagePropertiesMenus()", ex.Message); } }
void delay_Tick(object sender, EventArgs e) { ViewMSOTcSystem mainView = null; try { _delay.Stop(); mainView = new ViewMSOTcSystem(); mainView.StartMSOT(childWindowContainer); mainView.Show(); Close(); Application.Current.MainWindow = mainView; mainView.ShowPendingPushedMessages(); mainView = null; } finally { mainView?.Dispose(); } }
private void editButton_Click(object sender, RoutedEventArgs e) { ViewMSOTcSystem.ChangeModalAndEditState(true, this); KeyboardNavigation.SetTabNavigation(this, KeyboardNavigationMode.Cycle); }
private void saveButton_Click(object sender, RoutedEventArgs e) { ViewMSOTcSystem.ChangeModalAndEditState(false, this); KeyboardNavigation.SetTabNavigation(this, KeyboardNavigationMode.Continue); }
internal void HandlePreviewKeyDown(object sender, KeyEventArgs e) { if (_model == null) { return; } try { if (e.Key == Key.Return) { //Use refrection to get IxExtendedKey //For Numpad Enter Key, IsExtendedKey = True //For Main Keyboard Enter Key, IsExtendedKey = False bool isExtended = (bool)typeof(KeyEventArgs).InvokeMember("IsExtendedKey", System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, e, null); if (!isExtended) { return; } } Dictionary <Key, KeyboardShortcutDelegate> keyBindings; _affectedImagingSession = null; if (_model.ViewingLayout == SuperSessionViewingLayout.Layout1) { foreach (ViewModelImagingSessionBase session in _model.ImagingSessions) { if (session.IsVisible) { _affectedImagingSession = session; break; } } keyBindings = _singleViewKeyBindings; } else { for (int i = 0; i < imagingSessionsItemsControl.Items.Count; i++) { UIElement uiElement = (UIElement)imagingSessionsItemsControl.ItemContainerGenerator.ContainerFromIndex(i); if (uiElement.IsMouseOver) { _affectedImagingSession = (uiElement as FrameworkElement).DataContext as ViewModelImagingSessionBase; } } keyBindings = _multiViewKeyBindings; } if (_affectedImagingSession?.IsEmptyImagingSession ?? true) { return; } if (_affectedImagingSession.IsVisualizationRefreshing) { return; } ViewMSOTcSystem.LogMessage(Xvue.MSOT.Services.Log.EnumLogType.Info, "ViewImagingSuperSessionsGrid:HandlePreviewKeyDown", "Key: " + e.Key + ", SystemKey: " + e.SystemKey); KeyboardShortcutDelegate command; Key incomingKey; if (e.Key == Key.System) { incomingKey = e.SystemKey; } else { incomingKey = e.Key; } if (System.Windows.Forms.Control.IsKeyLocked(System.Windows.Forms.Keys.NumLock)) //show num lock status somewhere? { if (keyBindings.TryGetValue(incomingKey, out command)) { command(); e.Handled = true; } } } catch (Exception ex) { ViewMSOTcSystem.LogMessage(Xvue.MSOT.Services.Log.EnumLogType.Warning, "ViewImagingSuperSessionsGrid", "Exception executing shortcut:" + ex.Message); } }