protected Task ClickHandler() { Clicked?.Invoke(); ParentTabs?.SelectTab(Name); return(Task.CompletedTask); }
private void _connectionForm_Connected(object sender, EventArgs e) { Icon = ConnectionFactory.GetProtocol(_connection).ProtocolIcon; _iconPictureBox.Image = new Icon(Icon, 16, 16).ToBitmap(); ParentTabs.RedrawTabs(); }
private void _connectionForm_ConnectionLost(object sender, EventArgs e) { _iconPictureBox.Image = new Icon(Resources.EasyConnect, 16, 16).ToBitmap(); Icon = Resources.Disconnected; ParentTabs.RedrawTabs(); }
/// <inheritdoc/> protected override void OnInitialized() { ParentTabs?.NotifyTabPanelInitialized(Name); ParentTabsContent?.NotifyTabPanelInitialized(Name); base.OnInitialized(); }
protected override void OnInitialized() { if (ParentTabs != null) { ParentTabs.HookTab(Name); } base.OnInitialized(); }
/// <summary> /// Handles the item onclick event. /// </summary> /// <returns>A task that represents the asynchronous operation.</returns> protected async Task ClickHandler() { await Clicked.InvokeAsync(); if (ParentTabs != null) { await ParentTabs.SelectTab(Name); } }
/// <inheritdoc/> protected override void OnInitialized() { if (ParentTabs != null) { ParentTabs.NotifyTabInitialized(Name); } base.OnInitialized(); }
/// <inheritdoc/> protected override void Dispose(bool disposing) { if (disposing) { ParentTabs?.NotifyTabPanelRemoved(Name); ParentTabsContent?.NotifyTabPanelRemoved(Name); } base.Dispose(disposing); }
protected override void OnInitialized() { if (ParentTabs != null) { ParentTabs.HookTab(Name); Active = Name == ParentTabs.SelectedTab; ParentTabs.StateChanged += OnTabsStateChanged; } base.OnInitialized(); }
/// <inheritdoc/> protected override void OnInitialized() { if (ParentTabs != null) { ParentTabs.NotifyTabPanelInitialized(Name); } if (ParentTabsContent != null) { ParentTabsContent.NotifyTabPanelInitialized(Name); } base.OnInitialized(); }
protected override void OnInitialized() { if (ParentTabs != null) { ParentTabs.HookPanel(Name); } if (ParentTabsContent != null) { ParentTabsContent.Hook(Name); } base.OnInitialized(); }
/// <summary> /// Opens a connection to <see cref="_connection"/>. /// </summary> public async Task Connect() { // Set the top and height of the connection contain panel appropriately depending on if we're auto-hiding the toolbar if (AutoHideToolbar && !_connectionContainerPanelSizeSet) { _connectionContainerPanel.Top = 5; _connectionContainerPanel.Height += 31; } _urlPanel.Text = String.Format( @"<div style=""background-color: #FFFFFF; font-family: {2}; font-size: {3}pt; height: {4}px; color: #9999BF;"">{0}://<font color=""black"">{1}</font></div>", ConnectionFactory.GetProtocol(_connection).ProtocolPrefix, _connection.Host, urlTextBox.Font.FontFamily.GetName(0), urlTextBox.Font.SizeInPoints, _urlPanel.Height); _urlPanelContainer.Visible = true; urlTextBox.Visible = false; _urlPanel.PerformLayout(); // Initialize the UI elements _connectionContainerPanelSizeSet = true; _connectionForm = ConnectionFactory.CreateConnectionForm(_connection, _connectionContainerPanel); _connectionForm.ConnectionLost += _connectionForm_ConnectionLost; _connectionForm.Connected += _connectionForm_Connected; Icon = ConnectionFactory.GetProtocol(_connection).ProtocolIcon; _iconPictureBox.Image = new Icon(Icon, 16, 16).ToBitmap(); Text = _connection.DisplayName; _suppressOmniBar = true; urlTextBox.Text = ConnectionFactory.GetProtocol(_connection).ProtocolPrefix + "://" + _connection.Host; _suppressOmniBar = false; try { _connectionForm.Connect(); } catch (Exception) { Close(); return; } await ParentTabs.RegisterConnection(this, _connection); HideToolbar(); }
/// <inheritdoc/> protected override void Dispose(bool disposing) { if (disposing) { if (ParentTabs != null) { ParentTabs.NotifyTabPanelRemoved(Name); } if (ParentTabsContent != null) { ParentTabsContent.NotifyTabPanelRemoved(Name); } } base.Dispose(disposing); }
protected override void OnInitialized() { if (ParentTabs != null) { ParentTabs.HookPanel(Name); Active = Name == ParentTabs.SelectedTab; ParentTabs.StateChanged += OnTabsContentStateChanged; } if (ParentTabsContent != null) { ParentTabsContent.Hook(Name); Active = Name == ParentTabsContent.SelectedPanel; ParentTabsContent.StateChanged += OnTabsContentStateChanged; } base.OnInitialized(); }
/// <summary> /// Handler method that's called when the user clicks the "Options" menu item under the tools menu. Creates the options tab if one doesn't exist /// already and then switches to it. /// </summary> /// <param name="sender">Object from which this event originated.</param> /// <param name="e">Arguments associated with this event.</param> private async void _optionsMenuItem_Click(object sender, EventArgs e) { await ParentTabs.OpenOptions(); }
/// <summary> /// Handler method that's called when the user clicks the "Bookmarks manager" menu item under the bookmarks menu. Creates the bookmarks manager tab if /// one doesn't already exist then switches to it. /// </summary> /// <param name="sender">Object from which this event originated.</param> /// <param name="e">Arguments associated with this event.</param> private void _bookmarksManagerMenuItem2_Click(object sender, EventArgs e) { ParentTabs.OpenBookmarkManager(); }
/// <summary> /// Handler method that's called when the user clicks the "New tab" menu item under the tools menu. Creates a new tab and then switches to it. /// </summary> /// <param name="sender">Object from which this event originated.</param> /// <param name="e">Arguments associated with this event.</param> private void _newTabMenuItem_Click(object sender, EventArgs e) { ParentTabs.AddNewTab(); }
/// <inheritdoc/> protected override void OnInitialized() { ParentTabs?.NotifyTabInitialized(Name); base.OnInitialized(); }
protected void ClickHandler() { Clicked?.Invoke(); ParentTabs?.SelectTab(Name); }
protected override void OnInit() { ParentTabs?.Hook(this); base.OnInit(); }
/// <summary> /// Handles the item onclick event. /// </summary> /// <returns>A task that represents the asynchronous operation.</returns> protected async Task ClickHandler() { await Clicked.InvokeAsync(); ParentTabs?.SelectTab(Name); }
/// <summary> /// Handler method that's called when the user clicks the "History" menu item under the tools menu. Creates the history tab if one doesn't exist /// already and then switches to it. /// </summary> /// <param name="sender">Object from which this event originated.</param> /// <param name="e">Arguments associated with this event.</param> private void _historyToolStripMenuItem_Click(object sender, EventArgs e) { ParentTabs.OpenHistory(); }
/// <summary> /// Handler method that's called when the user clicks on the "Check for updates" menu item under the tools menu. Starts the update check process by /// calling <see cref="MainForm.CheckForUpdate"/> on <see cref="ParentTabs"/>. /// </summary> /// <param name="sender">Object from which this event originated.</param> /// <param name="e">Arguments associated with this event.</param> private void _updatesMenuItem_Click(object sender, EventArgs e) { ParentTabs.CheckForUpdate(); }
protected override void OnInit() { ParentTabs?.LinkTab(this); base.OnInit(); }