Esempio n. 1
0
        private void _switchPanel_SelectedSwitchButtonChanged(object sender, EventArgs e)
        {
            if (_switchPanel.SelectedSwitchButton != null)
            {
                Debug.Assert(_buttonPageDictionary != null, "_buttonPageDictionary != null");
                NuGenSwitchPage activeSwitchPage = _buttonPageDictionary[_switchPanel.SelectedSwitchButton];
                Debug.Assert(activeSwitchPage != null, "activeSwitchPage != null");
                activeSwitchPage.BringToFront();
            }

            this.OnSelectedSwitchPageChanged(e);
        }
Esempio n. 2
0
        /*
         * InitializeSwitchPage
         */

        private NuGenSwitchButton InitializeSwitchPage(NuGenSwitchPage switchPageToInitialize)
        {
            Debug.Assert(switchPageToInitialize != null, "switchPageToInitialize != null");
            Debug.Assert(this.ServiceProvider != null, "this.ServiceProvider != null");

            NuGenSwitchButton switchButtonToAssociate = new NuGenSwitchButton(this.ServiceProvider);

            switchButtonToAssociate.Image = switchPageToInitialize.SwitchButtonImage;
            switchButtonToAssociate.Text  = switchPageToInitialize.Text;

            Debug.Assert(_buttonPageDictionary != null, "_buttonPageDictionary != null");
            Debug.Assert(_pageButtonDictionary != null, "_pageButtonDictionary != null");
            _buttonPageDictionary.Add(switchButtonToAssociate, switchPageToInitialize);
            _pageButtonDictionary.Add(switchPageToInitialize, switchButtonToAssociate);

            switchPageToInitialize.EnabledChanged           += _switchPage_EnabledChanged;
            switchPageToInitialize.SwitchButtonImageChanged += _switchPage_SwitchButtonImageChanged;
            switchPageToInitialize.TextChanged += _switchPage_TextChanged;

            this.Controls.Add(switchPageToInitialize);
            switchPageToInitialize.BringToFront();

            return(switchButtonToAssociate);
        }
Esempio n. 3
0
		/*
		 * InitializeSwitchPage
		 */

		private NuGenSwitchButton InitializeSwitchPage(NuGenSwitchPage switchPageToInitialize)
		{
			Debug.Assert(switchPageToInitialize != null, "switchPageToInitialize != null");
			Debug.Assert(this.ServiceProvider != null, "this.ServiceProvider != null");

			NuGenSwitchButton switchButtonToAssociate = new NuGenSwitchButton(this.ServiceProvider);
			switchButtonToAssociate.Image = switchPageToInitialize.SwitchButtonImage;
			switchButtonToAssociate.Text = switchPageToInitialize.Text;

			Debug.Assert(_buttonPageDictionary != null, "_buttonPageDictionary != null");
			Debug.Assert(_pageButtonDictionary != null, "_pageButtonDictionary != null");
			_buttonPageDictionary.Add(switchButtonToAssociate, switchPageToInitialize);
			_pageButtonDictionary.Add(switchPageToInitialize, switchButtonToAssociate);

			switchPageToInitialize.EnabledChanged += _switchPage_EnabledChanged;
			switchPageToInitialize.SwitchButtonImageChanged += _switchPage_SwitchButtonImageChanged;
			switchPageToInitialize.TextChanged += _switchPage_TextChanged;

			this.Controls.Add(switchPageToInitialize);
			switchPageToInitialize.BringToFront();

			return switchButtonToAssociate;
		}