// Reads the selection settings for the active job-def-set from the // registry. // private string ReadJobDefSetPrefs() { Microsoft.Win32.RegistryKey Reg = m_Prefs.OpenKeyForLoading(); string Result = ""; if (Reg != null) { try { object RegValue; RegValue = Reg.GetValue(JobDefSetPrefsKeyName()); if (RegValue != null) { Result = RegValue.ToString(); } } catch (Exception x) { // ignore error System.Diagnostics.Debug.Assert(false); System.Diagnostics.Debug.WriteLine(x.ToString()); } } return(Result); }
private void Load(Preferences Prefs) { Microsoft.Win32.RegistryKey Reg = Prefs.OpenKeyForLoading(); if (Reg == null) { return; } try { string Value = Reg.GetValue("ProcessPriority").ToString(); m_ProcessPriority = (ProcessPriorityClass) System.Enum.Parse(typeof(ProcessPriorityClass), Value); } catch (Exception x) { Debug.WriteLine("Unable to load ProcessPriority preference. " + x.ToString()); } try { string Value = Reg.GetValue("MaxLogFileAge").ToString(); m_MaxLogFileAge = Convert.ToInt32(Value); } catch (Exception x) { Debug.WriteLine("Unable to load MaxLogFileAge preference. " + x.ToString()); } }