Esempio n. 1
0
        /// <summary>
        /// Get an instance of the UserControl
        /// </summary>
        /// <returns></returns>
        public static Settings_Panel GetInstance()
        {
            if (instance == null)
            {
                // Get an instance, if does not already exists
                instance = new Settings_Panel();
            }

            return(instance);
        }
Esempio n. 2
0
        /// <summary>
        /// Applys the settings if they have been reset to deafult on form closing
        /// </summary>
        /// <param name="e"></param>
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            // Check if the settings have been reset to default
            if (Settings_Panel.isReset)
            {
                // If yes, apply the settings
                Settings_Panel settingsPnl = new Settings_Panel();
                settingsPnl.ApplySettings();
            }

            base.OnFormClosing(e);
        }
Esempio n. 3
0
        /// <summary>
        /// Initialization
        /// </summary>
        /// <param name="instance"></param>
        public Common(string instance)
        {
            InitializeComponent();

            // Check whcih window user wants to open
            if (instance == Main.SETTINGS_PANEL)
            {
                // Launch Settings_Panel
                Text = Main.SETTINGS_PANEL;
                panelContainer.Controls.Add(Settings_Panel.GetInstance());
            }
            else
            {
                // Launch Custom_Config_Panel
                Text = Main.CUSTOM_CONFIG_PANEL;
                panelContainer.Controls.Add(Custom_Config_Panel.GetInstance());
            }
        }