Exemplo n.º 1
0
        protected Task ClickHandler()
        {
            Clicked?.Invoke();
            ParentTabs?.SelectTab(Name);

            return(Task.CompletedTask);
        }
Exemplo n.º 2
0
        private void _connectionForm_Connected(object sender, EventArgs e)
        {
            Icon = ConnectionFactory.GetProtocol(_connection).ProtocolIcon;
            _iconPictureBox.Image = new Icon(Icon, 16, 16).ToBitmap();

            ParentTabs.RedrawTabs();
        }
Exemplo n.º 3
0
        private void _connectionForm_ConnectionLost(object sender, EventArgs e)
        {
            _iconPictureBox.Image = new Icon(Resources.EasyConnect, 16, 16).ToBitmap();

            Icon = Resources.Disconnected;
            ParentTabs.RedrawTabs();
        }
Exemplo n.º 4
0
        /// <inheritdoc/>
        protected override void OnInitialized()
        {
            ParentTabs?.NotifyTabPanelInitialized(Name);

            ParentTabsContent?.NotifyTabPanelInitialized(Name);

            base.OnInitialized();
        }
Exemplo n.º 5
0
        protected override void OnInitialized()
        {
            if (ParentTabs != null)
            {
                ParentTabs.HookTab(Name);
            }

            base.OnInitialized();
        }
Exemplo n.º 6
0
        /// <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);
            }
        }
Exemplo n.º 7
0
        /// <inheritdoc/>
        protected override void OnInitialized()
        {
            if (ParentTabs != null)
            {
                ParentTabs.NotifyTabInitialized(Name);
            }

            base.OnInitialized();
        }
Exemplo n.º 8
0
        /// <inheritdoc/>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                ParentTabs?.NotifyTabPanelRemoved(Name);

                ParentTabsContent?.NotifyTabPanelRemoved(Name);
            }

            base.Dispose(disposing);
        }
Exemplo n.º 9
0
        protected override void OnInitialized()
        {
            if (ParentTabs != null)
            {
                ParentTabs.HookTab(Name);

                Active = Name == ParentTabs.SelectedTab;

                ParentTabs.StateChanged += OnTabsStateChanged;
            }

            base.OnInitialized();
        }
Exemplo n.º 10
0
        /// <inheritdoc/>
        protected override void OnInitialized()
        {
            if (ParentTabs != null)
            {
                ParentTabs.NotifyTabPanelInitialized(Name);
            }

            if (ParentTabsContent != null)
            {
                ParentTabsContent.NotifyTabPanelInitialized(Name);
            }

            base.OnInitialized();
        }
Exemplo n.º 11
0
        protected override void OnInitialized()
        {
            if (ParentTabs != null)
            {
                ParentTabs.HookPanel(Name);
            }

            if (ParentTabsContent != null)
            {
                ParentTabsContent.Hook(Name);
            }

            base.OnInitialized();
        }
Exemplo n.º 12
0
        /// <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();
        }
Exemplo n.º 13
0
        /// <inheritdoc/>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (ParentTabs != null)
                {
                    ParentTabs.NotifyTabPanelRemoved(Name);
                }

                if (ParentTabsContent != null)
                {
                    ParentTabsContent.NotifyTabPanelRemoved(Name);
                }
            }

            base.Dispose(disposing);
        }
Exemplo n.º 14
0
        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();
        }
Exemplo n.º 15
0
 /// <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();
 }
Exemplo n.º 16
0
 /// <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();
 }
Exemplo n.º 17
0
 /// <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();
 }
Exemplo n.º 18
0
        /// <inheritdoc/>
        protected override void OnInitialized()
        {
            ParentTabs?.NotifyTabInitialized(Name);

            base.OnInitialized();
        }
Exemplo n.º 19
0
 protected void ClickHandler()
 {
     Clicked?.Invoke();
     ParentTabs?.SelectTab(Name);
 }
Exemplo n.º 20
0
        protected override void OnInit()
        {
            ParentTabs?.Hook(this);

            base.OnInit();
        }
Exemplo n.º 21
0
        /// <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);
        }
Exemplo n.º 22
0
 /// <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();
 }
Exemplo n.º 23
0
 /// <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();
 }
Exemplo n.º 24
0
        protected override void OnInit()
        {
            ParentTabs?.LinkTab(this);

            base.OnInit();
        }