private void GetUserPrefernces(object sender, EventArgs e) { RoboSep_UserPreferences userPref = (RoboSep_UserPreferences)sender; Dictionary <string, bool> dictUser = userPref.UserPreferences; Dictionary <string, bool> dictDevice = userPref.DevicePreferences; if (dictUser.Count > 0) { if (dictUserPreferences == null) { dictUserPreferences = new Dictionary <string, bool>(); copyPreferences(dictUser, dictUserPreferences); } } if (dictDevice.Count > 0) { if (dictDevicePreferences == null) { dictDevicePreferences = new Dictionary <string, bool>(); copyPreferences(dictDevice, dictDevicePreferences); } } }
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(); }
private void HandleClosingUserPreferencesApp(object sender, EventArgs e) { this.Visible = true; this.Show(); this.BringToFront(); if (myUserPreferences != null) { myUserPreferences.Dispose(); myUserPreferences = null; } }