コード例 #1
0
        protected Task ClickHandler()
        {
            Clicked?.Invoke();
            ParentTabs?.SelectTab(Name);

            return(Task.CompletedTask);
        }
コード例 #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();
        }
コード例 #3
0
        private void _connectionForm_ConnectionLost(object sender, EventArgs e)
        {
            _iconPictureBox.Image = new Icon(Resources.EasyConnect, 16, 16).ToBitmap();

            Icon = Resources.Disconnected;
            ParentTabs.RedrawTabs();
        }
コード例 #4
0
        /// <inheritdoc/>
        protected override void OnInitialized()
        {
            ParentTabs?.NotifyTabPanelInitialized(Name);

            ParentTabsContent?.NotifyTabPanelInitialized(Name);

            base.OnInitialized();
        }
コード例 #5
0
        protected override void OnInitialized()
        {
            if (ParentTabs != null)
            {
                ParentTabs.HookTab(Name);
            }

            base.OnInitialized();
        }
コード例 #6
0
ファイル: Tab.razor.cs プロジェクト: weiplanet/Blazorise
        /// <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);
            }
        }
コード例 #7
0
ファイル: Tab.razor.cs プロジェクト: yumesmile/Blazorise
        /// <inheritdoc/>
        protected override void OnInitialized()
        {
            if (ParentTabs != null)
            {
                ParentTabs.NotifyTabInitialized(Name);
            }

            base.OnInitialized();
        }
コード例 #8
0
        /// <inheritdoc/>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                ParentTabs?.NotifyTabPanelRemoved(Name);

                ParentTabsContent?.NotifyTabPanelRemoved(Name);
            }

            base.Dispose(disposing);
        }
コード例 #9
0
        protected override void OnInitialized()
        {
            if (ParentTabs != null)
            {
                ParentTabs.HookTab(Name);

                Active = Name == ParentTabs.SelectedTab;

                ParentTabs.StateChanged += OnTabsStateChanged;
            }

            base.OnInitialized();
        }
コード例 #10
0
ファイル: TabPanel.razor.cs プロジェクト: yumesmile/Blazorise
        /// <inheritdoc/>
        protected override void OnInitialized()
        {
            if (ParentTabs != null)
            {
                ParentTabs.NotifyTabPanelInitialized(Name);
            }

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

            base.OnInitialized();
        }
コード例 #11
0
        protected override void OnInitialized()
        {
            if (ParentTabs != null)
            {
                ParentTabs.HookPanel(Name);
            }

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

            base.OnInitialized();
        }
コード例 #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();
        }
コード例 #13
0
ファイル: TabPanel.razor.cs プロジェクト: yumesmile/Blazorise
        /// <inheritdoc/>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (ParentTabs != null)
                {
                    ParentTabs.NotifyTabPanelRemoved(Name);
                }

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

            base.Dispose(disposing);
        }
コード例 #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();
        }
コード例 #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();
 }
コード例 #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();
 }
コード例 #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();
 }
コード例 #18
0
ファイル: Tab.razor.cs プロジェクト: techierathore/Blazorise
        /// <inheritdoc/>
        protected override void OnInitialized()
        {
            ParentTabs?.NotifyTabInitialized(Name);

            base.OnInitialized();
        }
コード例 #19
0
 protected void ClickHandler()
 {
     Clicked?.Invoke();
     ParentTabs?.SelectTab(Name);
 }
コード例 #20
0
ファイル: BaseTab.cs プロジェクト: EnhWeb/DC.Blazor
        protected override void OnInit()
        {
            ParentTabs?.Hook(this);

            base.OnInit();
        }
コード例 #21
0
ファイル: Tab.razor.cs プロジェクト: yumesmile/Blazorise
        /// <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);
        }
コード例 #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();
 }
コード例 #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();
 }
コード例 #24
0
        protected override void OnInit()
        {
            ParentTabs?.LinkTab(this);

            base.OnInit();
        }