private void hex_UserPreferences_Click(object sender, EventArgs e) { RoboSep_UserConsole.getInstance().SuspendLayout(); if (myUserPreferences != null) { myUserPreferences.Dispose(); myUserPreferences = null; } myUserPreferences = new RoboSep_UserPreferences(RoboSep_UserConsole.strCurrentUser, false, true); myUserPreferences.Parent = this.Parent; myUserPreferences.ClosingUserPreferencesApp += new EventHandler(HandleClosingUserPreferencesApp); //myUserPreferences.Location = new Point(0, 0); // RoboSep_UserConsole.getInstance().Controls.Add(myUserPreferences); // RoboSep_UserConsole.ctrlCurrentUserControl = myUserPreferences; myUserPreferences.Show(); myUserPreferences.BringToFront(); myUserPreferences.Focus(); // LOG string logMSG = "User Preferences button clicked"; LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, logMSG); }
private void button_User_Settings_Click(object sender, EventArgs e) { string sUserLoginID; if (bCreateNewUser) { // New user sUserLoginID = textBox_NewUserLoginID.Text; } else { // edit user sUserLoginID = DefaultLoginID; } if (string.IsNullOrEmpty(sUserLoginID) || sUserLoginID.Trim().Length == 0) { return; } if (userPreferences != null) { // let garbage collector to dispose this item userPreferences.Dispose(); userPreferences = null; } userPreferences = new RoboSep_UserPreferences(sUserLoginID, bCreateNewUser? true : false, false); userPreferences.GetUserPreferences += new EventHandler(GetUserPrefernces); userPreferences.ClosingUserPreferencesApp += new EventHandler(HandleClosingUserPreferencesApp); userPreferences.Parent = this; userPreferences.Show(); userPreferences.BringToFront(); userPreferences.Focus(); }