private void mResetPreferences_Click(object sender, System.EventArgs e) { MhoraGlobalOptions mh = new MhoraGlobalOptions(); MhoraGlobalOptions.Instance = mh; MhoraGlobalOptions.NotifyDisplayChange(); MhoraGlobalOptions.NotifyCalculationChange(); }
public void saveToFile() { Console.WriteLine("Saving Preferences to {0}", MhoraGlobalOptions.getOptsFilename()); FileStream sOut = new FileStream(MhoraGlobalOptions.getOptsFilename(), FileMode.OpenOrCreate, FileAccess.Write); BinaryFormatter formatter = new BinaryFormatter(); formatter.Serialize(sOut, this); sOut.Close(); }
private void MhoraContainer_Load(object sender, System.EventArgs e) { gOpts = MhoraGlobalOptions.readFromFile(); MhoraGlobalOptions.mainControl = this; if (MhoraGlobalOptions.Instance.ShowSplashScreen) { Genghis.Windows.Forms.SplashScreen ss = new Genghis.Windows.Forms.SplashScreen(typeof(MhoraSplash), Genghis.Windows.Forms.SplashScreenStyles.TopMost); System.Threading.Thread.Sleep(0); ss.Close(null, 1000); } this.openNewJhdFile(); }
static public MhoraGlobalOptions readFromFile() { MhoraGlobalOptions gOpts = new MhoraGlobalOptions(); try { FileStream sOut; sOut = new FileStream(MhoraGlobalOptions.getOptsFilename(), FileMode.Open, FileAccess.Read); BinaryFormatter formatter = new BinaryFormatter(); formatter.AssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple; gOpts = (MhoraGlobalOptions)formatter.Deserialize(sOut); sOut.Close(); } catch { Console.WriteLine("MHora: Unable to read user preferences", "GlobalOptions"); } MhoraGlobalOptions.Instance = gOpts; return(gOpts); }
public object updateCalcPreferences(object o) { sweph.swe_set_ephe_path(MhoraGlobalOptions.Instance.HOptions.EphemerisPath); MhoraGlobalOptions.NotifyCalculationChange(); return(o); }
private void mDecreaseFontSize_Click(object sender, System.EventArgs e) { MhoraGlobalOptions.Instance.decreaseFontSize(); MhoraGlobalOptions.NotifyDisplayChange(); }
private void mResetStrengthPreferences_Click(object sender, System.EventArgs e) { MhoraGlobalOptions.Instance.SOptions = new StrengthOptions(); MhoraGlobalOptions.NotifyCalculationChange(); }
private object updateDisplayPreferences(object o) { MhoraGlobalOptions.NotifyDisplayChange(); sweph.swe_set_ephe_path(MhoraGlobalOptions.Instance.HOptions.EphemerisPath); return(o); }
public static void NotifyCalculationChange() { MhoraGlobalOptions.CalculationPrefsChanged(MhoraGlobalOptions.Instance.HOptions); }
public static void NotifyDisplayChange() { MhoraGlobalOptions.DisplayPrefsChanged(MhoraGlobalOptions.Instance); }