//public HashSet<Word.Range> TotalRange = new HashSet<Word.Range>(); public static Resident Resident_getInstance(WooTable _MasterObject) { //get { if (_inst == null) { _inst = new Resident(_MasterObject); } return(_inst); } }
private void Ribbon1_Load(object sender, RibbonUIEventArgs e) { try { _resident = Resident.Resident_getInstance(this); //_resident.setMasterObject(this); //_cconvert = CurrencyConverter.CurrencyConverter_getInstance; //setButtonStates(); //DO NOT USE, deprecated //lab_WooTable_Free.Label = "This is a free version. Please donate!"; } catch (Exception E) { System.Windows.Forms.MessageBox.Show("Fatal error: " + E.Message, "WooTable .::. Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } }
private void Form_Settings_but_Apply_Click(object sender, EventArgs e) { try { Properties.Settings.Default.StatusBarUpdate = Form_Settings_check_ModifyStatusBar.Checked; Properties.Settings.Default.Show_Min = Form_Settings_check_ShowMin.Checked; Properties.Settings.Default.Show_Max = Form_Settings_check_ShowMax.Checked; Properties.Settings.Default.Show_Median = Form_Settings_check_ShowMedian.Checked; double _temp = fcie.GetNumeric(Form_Settings_text_Ratio.Text, System.Globalization.NumberStyles.Any); if (_temp > double.MinValue) { Properties.Settings.Default.Curr_Risk = _temp; } Properties.Settings.Default.Curr_Provider = Form_Settings_combo_Provider.Text; Properties.Settings.Default.OracleDataLocation = Form_Settings_combo_OracleDataLocation.Text; Properties.Settings.Default.DialogOnMath = Form_Settings_check_DialogOnMath.Checked; Properties.Settings.Default.XLSNewLine = Form_Settings_check_ReplaceNLine.Checked; String temp = Form_Settings_combo_lang.Text; Properties.Settings.Default.Culture = temp.Substring(temp.LastIndexOf("(") + 1, temp.LastIndexOf(")") - temp.LastIndexOf("(") - 1); Properties.Settings.Default.CultureString = temp.Substring(0, temp.LastIndexOf("(") - 1); Properties.Settings.Default.Save(); //ThisRibbon.setButtonStates(); // DO NOT USE, deprecated //Oracle login and password PasswordManager.SavePassword(Properties.Settings.Default.WooTable_OracleData, Form_Settings_text_OracleDataUsername.Text, Form_Settings_text_OracleDataPassword.Text); //set language Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(Properties.Settings.Default.Culture); Resident _resident = Resident.Resident_getInstance(null); _resident.RefreshAll(); } finally { this.Close(); } }
private Resident(WooTable _MasterObject) { try { ThisApp = Globals.ThisAddIn.Application; setMasterObject(_MasterObject); try { if (Properties.Settings.Default.Culture == "") { Properties.Settings.Default.Culture = Thread.CurrentThread.CurrentUICulture.Name; Properties.Settings.Default.CultureString = Thread.CurrentThread.CurrentUICulture.NativeName; } Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(Properties.Settings.Default.Culture); } catch { Properties.Settings.Default.Culture = Thread.CurrentThread.CurrentUICulture.Name; Properties.Settings.Default.CultureString = Thread.CurrentThread.CurrentUICulture.NativeName; Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(Thread.CurrentThread.CurrentUICulture.Name); } StringSetter.setStringAll(MasterObject, "tip"); StringSetter.setStringAll(MasterObject, "label"); StringSetter.setGroupNames(MasterObject); //these are the ribbon groups labels // start up Startup(); } catch (Exception E) { System.Windows.Forms.MessageBox.Show("Could not initialize the resident service: " + E.Message + ". Am stopping it.", "WooTable .::. Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); _inst = null; } }