private void StopScreenshotProcess() { if (this.IsPreviewing && !this.isStoppingPreview) { this.isStoppingPreview = true; this.mediaCenterProcess.Exited -= new EventHandler(this.MediaCenterProcess_Exited); base.Dispatcher.ShutdownStarted -= new EventHandler(this.Dispatcher_ShutdownStarted); this.themeManager.AppliedThemes.Clear(); foreach (ThemeSummary summary in this.previousThemes) { this.themeManager.AppliedThemes.Add(summary); } IProgressEnabledOperation operation = this.themeManager.ApplyThemesAsync(false, true); operation.Completed += delegate { Action method = delegate { this.IsPreviewing = false; this.isStoppingPreview = false; this.preview.Dispose(); this.preview = null; this.previousThemes = null; this.mediaCenterProcess = null; this.themeManager = null; }; base.Dispatcher.Invoke(DispatcherPriority.Normal, method); }; VmcStudioUtil.Application.ExclusiveOperation = operation; } }
private void btnPreview_Click(object sender, RoutedEventArgs e) { if (windowPreview == null || (windowPreview != null && !windowPreview.IsLoaded)) { windowPreview = new WindowPreview(); windowPreview.Update(this); windowPreview.Show(); } }
private void ApplicationSwitchWindows_Click(object sender, RoutedEventArgs e) { ActiveWindowScreenCapture(); WindowPreview.Visibility = Visibility.Visible; WindowPreview.UpdatePreviews(); return; }
private void StartScreenshotProcess() { if (!this.IsPreviewing && !this.isStartingPreview) { this.isStartingPreview = true; this.themeManager = VmcStudioUtil.Application.ThemeManager; this.previousThemes = new List <ThemeSummary>(this.themeManager.AppliedThemes); this.themeManager.AppliedThemes.Clear(); this.themeManager.AppliedThemes.Add(Enumerable.First <ThemeSummary>(this.themeManager.Themes, (Func <ThemeSummary, bool>)(o => (this.ThemeItem.Theme.ID == o.ID)))); IProgressEnabledOperation operation = this.themeManager.ApplyThemesAsync(true, true); operation.Completed += delegate { Action action2 = null; this.mediaCenterProcess = MediaCenterUtil.LaunchMediaCenter(false, true, true); this.mediaCenterProcess.EnableRaisingEvents = true; this.mediaCenterProcess.Exited += new EventHandler(this.MediaCenterProcess_Exited); base.Dispatcher.ShutdownStarted += new EventHandler(this.Dispatcher_ShutdownStarted); IntPtr windowHandle = IntPtr.Zero; for (int j = 0; (windowHandle == IntPtr.Zero) && (j < 20); j++) { Thread.Sleep(500); windowHandle = MediaCenterUtil.GetMediaCenterWindow(); } if (windowHandle != IntPtr.Zero) { if (action2 == null) { action2 = delegate { this.preview = new WindowPreview(this.previewWindow, windowHandle); this.preview.ClientAreaOnly = true; this.preview.IsVisible = true; this.IsPreviewing = true; this.isStartingPreview = false; }; } Action method = action2; base.Dispatcher.Invoke(DispatcherPriority.Normal, method); } }; VmcStudioUtil.Application.ExclusiveOperation = operation; } }
private void Workspace_KeyUp(object sender, KeyEventArgs e) { Boolean keyHandled = false; if (e.Key == Key.Ctrl) { keydownControl = false; } if (e.Key == Key.Shift) { keydownShift = false; } if (e.Key == Key.Alt) { keydownAlt = false; } keyHandled = ((e.Key == Key.Ctrl) || (e.Key == Key.Shift) || (e.Key == Key.Alt)); if ((e.Key == Key.Escape) && (WindowPreview.Visibility == Visibility.Visible)) { WindowPreview.WindowClose_Click(null, null); keyHandled = true; } if (!keyHandled) { if ((keydownControl) && (!keydownAlt) && (!keydownShift)) // ONLY CONTROL KEY IS DOWN { #region CONTROL KEY (KEY UP) if (e.Key == Key.Unknown) { switch (e.PlatformKeyCode) { case 192: this.Dispatcher.BeginInvoke(delegate { ApplicationSwitchWindows_Click(null, null); }); keyHandled = true; break; } } else { switch (e.Key) { case Key.Tab: break; case Key.D4: if ((ActiveWindowContent.Child != null) && (LayoutRoot.RowDefinitions[1].Height == new GridLength(0))) { if (ActiveWindowContent.Child is Silverlight.WindowManager.Window) { Silverlight.WindowManager.Window activeWindow = (Silverlight.WindowManager.Window)ActiveWindowContent.Child; activeWindow.WindowCommand_Close(); } } break; case Key.Q: WindowManager.OpenWindow("Workspace.GlobalSearch", new Dictionary <String, Object> ()); keyHandled = true; break; } } #endregion } else if ((keydownControl) && (!keydownAlt) && (keydownShift)) // CONTROL-SHIFT (ONLY) { #region CONTROL-SHIFT (KEY UP) if (e.Key == Key.Unknown) { switch (e.PlatformKeyCode) { case 192: this.Dispatcher.BeginInvoke(delegate { ApplicationShowWorkspace_Click(null, null); }); keyHandled = true; break; } } else { switch (e.Key) { case Key.Tab: break; } } #endregion } } return; }