예제 #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);
        }
예제 #2
0
파일: Common.cs 프로젝트: haZya/8-Puzzle
        /// <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);
        }
예제 #3
0
파일: Common.cs 프로젝트: haZya/8-Puzzle
        /// <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());
            }
        }