public SetWindowIcon ( |
||
icon | System.Drawing.Icon for the window/control associated with this preview | |
return | void |
public void InitalizeDWM() { TabbedThumbnail thumbnail = new TabbedThumbnail(this.Handle, Editor); TaskbarManager.Instance.TabbedThumbnail.AddThumbnailPreview(thumbnail); thumbnail.SetImage(new Bitmap(Editor.Image)); thumbnail.DisplayFrameAroundBitmap = false; thumbnail.Title = "Paint Bucket"; thumbnail.SetWindowIcon(this.Icon); }
public void Tabify(Control targetControl) { if (TaskbarManager.Instance.TabbedThumbnail.IsThumbnailPreviewAdded(targetControl)) { return; } var thumbnail = new TabbedThumbnail(_form.Handle, targetControl) { Title = targetControl.Text, Tooltip = targetControl.Text }; thumbnail.TabbedThumbnailActivated += (sender, e) => OnThumbnailActivated(targetControl); thumbnail.TabbedThumbnailClosed += (sender, e) => OnThumbnailClosed(targetControl); thumbnail.TabbedThumbnailBitmapRequested += (sender, e) => CreateThumbnailBitmap(thumbnail, targetControl); thumbnail.SetWindowIcon(_form.Icon); TaskbarManager.Instance.TabbedThumbnail.AddThumbnailPreview(thumbnail); SetActiveTab(targetControl); CreateThumbnailBitmap(thumbnail, targetControl); }
protected void Connect(RDCConnection connection) { _history.AddToHistory(connection); RDCWindow sessionWindow = new RDCWindow(_password); _addingWindow = true; Tabs.Add(new TitleBarTab(this) { Content = sessionWindow }); _addingWindow = false; sessionWindow.FormClosing += sessionWindow_FormClosing; sessionWindow.Connected += sessionWindow_Connected; sessionWindow.Connect(connection); TabbedThumbnail preview = new TabbedThumbnail(Handle, sessionWindow); preview.Title = sessionWindow.Text; preview.Tooltip = sessionWindow.Text; preview.SetWindowIcon(sessionWindow.Icon); preview.TabbedThumbnailActivated += new EventHandler<TabbedThumbnailEventArgs>(preview_TabbedThumbnailActivated); preview.TabbedThumbnailClosed += new EventHandler<TabbedThumbnailEventArgs>(preview_TabbedThumbnailClosed); preview.TabbedThumbnailBitmapRequested += new EventHandler<TabbedThumbnailBitmapRequestedEventArgs>(preview_TabbedThumbnailBitmapRequested); preview.PeekOffset = new Vector(sessionWindow.Location.X, sessionWindow.Location.Y); for (Control currentControl = sessionWindow.Parent; currentControl.Parent != null; currentControl = currentControl.Parent) preview.PeekOffset += new Vector(currentControl.Location.X, currentControl.Location.Y); TaskbarManager.Instance.TabbedThumbnail.AddThumbnailPreview(preview); TaskbarManager.Instance.TabbedThumbnail.SetActiveTab(preview); if (_recentConnections.FirstOrDefault((HistoryWindow.HistoricalConnection c) => c.Guid == connection.Guid) == null) { _recentCategory.AddJumpListItems(new JumpListLink(Application.ExecutablePath, sessionWindow.Text) { Arguments = "/openHistory:" + connection.Guid.ToString(), IconReference = new IconReference(Application.ExecutablePath, 0) }); _jumpList.Refresh(); _recentConnections.Enqueue(_history.Connections.First((HistoryWindow.HistoricalConnection c) => c.Guid == connection.Guid)); if (_recentConnections.Count > _jumpList.MaxSlotsInList) _recentConnections.Dequeue(); } }
private void CreateInstances() { for (int i = 0; i < _Config.Accounts.Count; i++) { Account account = _Config.Accounts[i]; if (_Instances.ContainsKey(account.FullAddress)) { continue; } Notifier notifier = new Notifier(i); notifier.FormClosed += _Notifier_FormClosed; notifier.CheckMailFinished += _Notifier_CheckFinished; _Instances.Add(account.FullAddress, notifier); notifier.Show(this); TabbedThumbnail preview = new TabbedThumbnail(base.Handle, notifier.Handle); preview.TabbedThumbnailClosed += _Preview_TabbedThumbnailClosed; preview.SetWindowIcon(Utilities.ResourceHelper.GetIcon("gmail-classic.ico")); preview.Tooltip = String.Empty; preview.Title = account.FullAddress; _TaskbarManager.TabbedThumbnail.AddThumbnailPreview(preview); } if (_Config.Accounts.Count > 0) { Account account = _Config.Accounts[0]; _TaskbarManager.TabbedThumbnail.SetActiveTab(_Instances[account.FullAddress].Handle); } }
internal void SetupThumbAndButtons() { _thumbForm = new ThumbForm(this); _thumb = new TabbedThumbnail(this.Handle, _thumbForm); _thumb.Title = _gmailClient.Username; _thumb.SetWindowIcon((Icon)this.Icon.Clone()); _thumbForm.Show(); _thumbForm.Render(); _prevButton = new ThumbnailToolBarButton(Properties.Resources.Previous, "Previous") { Enabled = false }; _openButton = new ThumbnailToolBarButton(Properties.Resources.Open, "Open") { Enabled = false }; _nextButton = new ThumbnailToolBarButton(Properties.Resources.Next, "Next") { Enabled = false }; _prevButton.Click += new EventHandler<ThumbnailButtonClickedEventArgs>(PrevButtonClicked); _openButton.Click += new EventHandler<ThumbnailButtonClickedEventArgs>(OpenButtonClicked); _nextButton.Click += new EventHandler<ThumbnailButtonClickedEventArgs>(NextButtonClicked); TaskbarManager.Instance.TabbedThumbnail.AddThumbnailPreview(_thumb); TaskbarManager.Instance.ThumbnailToolBars.AddButtons(_thumbForm.Handle, _prevButton, _openButton, _nextButton); }
/// <summary> /// Creates a new thumbnail for <paramref name="tab" /> when the application is initially enabled for AeroPeek or when it is turned on sometime during /// execution. /// </summary> /// <param name="tab">Tab that we are to create the thumbnail for.</param> /// <returns>Thumbnail created for <paramref name="tab" />.</returns> protected virtual TabbedThumbnail CreateThumbnailPreview(TitleBarTab tab) { TabbedThumbnail preview = new TabbedThumbnail(Handle, tab.Content) { Title = tab.Content.Text, Tooltip = tab.Content.Text }; preview.SetWindowIcon(tab.Content.Icon); preview.TabbedThumbnailActivated += preview_TabbedThumbnailActivated; preview.TabbedThumbnailClosed += preview_TabbedThumbnailClosed; preview.TabbedThumbnailBitmapRequested += preview_TabbedThumbnailBitmapRequested; preview.PeekOffset = new Vector(Padding.Left, Padding.Top - 1); TaskbarManager.Instance.TabbedThumbnail.AddThumbnailPreview(preview); return preview; }
internal void SetupThumbAndButtons() { _thumbForm = new ThumbForm(this); _thumb = new TabbedThumbnail(this.Handle, _thumbForm); _thumb.Title = _gmailClient.Username; _thumb.SetWindowIcon((Icon)this.Icon.Clone()); _thumb.TabbedThumbnailClosed += (sender, e) => { //ideally what i would like to here is cancel the close event //unfortunately it appears there is a bug in the WindowsAPICodePack which is not receiving any attention from Microsoft //the next best alternative is just to close the entire application, otherwise it will crash next time we try to update the thumbnail preview Close(); }; _thumbForm.Show(); _thumbForm.Render(); _prevButton = new ThumbnailToolBarButton(Properties.Resources.Previous, "Previous") { Enabled = false }; _openButton = new ThumbnailToolBarButton(Properties.Resources.Open, "Open") { Enabled = false }; _nextButton = new ThumbnailToolBarButton(Properties.Resources.Next, "Next") { Enabled = false }; _prevButton.Click += new EventHandler<ThumbnailButtonClickedEventArgs>(PrevButtonClicked); _openButton.Click += new EventHandler<ThumbnailButtonClickedEventArgs>(OpenButtonClicked); _nextButton.Click += new EventHandler<ThumbnailButtonClickedEventArgs>(NextButtonClicked); TaskbarManager.Instance.TabbedThumbnail.AddThumbnailPreview(_thumb); TaskbarManager.Instance.ThumbnailToolBars.AddButtons(_thumbForm.Handle, _prevButton, _openButton, _nextButton); }