private void CleanupThumbnail() { if (_thumbnailForm == null) { return; } _thumbnailForm.Close(); _thumbnailForm = null; }
private void ShowThumbnailOnEnter(object sender, EventArgs e) { if (!(sender is ToolStripMenuItem captureWindowItem)) { return; } var window = captureWindowItem.Tag as IInteropWindow; if (_thumbnailForm == null) { _thumbnailForm = new ThumbnailForm(); } _thumbnailForm.ShowThumbnail(window, captureWindowItem.GetCurrentParent().TopLevelControl); }
public static void Main(String[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (args.Length > 0 && File.Exists(args[0])) { ThumbnailForm form = new ThumbnailForm(); form.InitialThumbsDb = args[0]; Application.Run(form); } else { MainForm form = new MainForm(); Application.Run(form); } }
public void Startup() { var uiSynchronizationContext = SynchronizationContext.Current; var keyHandler = new KeyCombinationHandler(_pipConfiguration.HotKey) { CanRepeat = false, IsPassThrough = false }; KeyboardHook.KeyboardEvents .Where(keyHandler) .SubscribeOn(uiSynchronizationContext) .ObserveOn(uiSynchronizationContext) .Subscribe(keyboardHookEventArgs => { // Get the current active window var pipSource = InteropWindowQuery.GetForegroundWindow(); while (pipSource.GetParent() != IntPtr.Zero) { pipSource = InteropWindowFactory.CreateFor(pipSource.GetParent()); } // If there is already a form, close it and remove it from the dictionary if (_thumbnailForms.TryGetValue(pipSource.Handle, out var thumbnailForm)) { thumbnailForm.Close(); _thumbnailForms.Remove(pipSource.Handle); return; } // Check if we have a location available if (!_locationPool.HasAvailable) { return; } thumbnailForm = new ThumbnailForm(_pipConfiguration, _locationPool, pipSource.Handle, uiSynchronizationContext); _thumbnailForms[pipSource.Handle] = thumbnailForm; thumbnailForm.Show(); }); }
private void menuItem_View_Thumbnail_Click(object sender, EventArgs e) { ThumbnailForm.ShowView(this, this.imageComponent.ImageWrapper); }
private void __toolsThumbs_Click(object sender, EventArgs e) { ThumbnailForm form = new ThumbnailForm(); form.ShowDialog(this); }