Пример #1
0
        public static void LoadTraySettings(TraySettingsType traySettingsType)
        {
            RegistryKey key = Registry.LocalMachine.OpenSubKey(APPLICATION_TRAY_REGISTRY_KEY, false);

            if (key != null)
            {
                switch (traySettingsType)
                {
                case TraySettingsType.TrayWindowVisibility:
                    TraySettings.WindowVisible = bool.Parse((string)key.GetValue("Tray Window Visible", TraySettings.DEFAULT_WINDOW_VISIBLE));
                    break;

                case TraySettingsType.TrayStartupWithWindows:
                    TraySettings.StartWithWindows = bool.Parse((string)key.GetValue("Start Tray With Windows", TraySettings.DEFAULT_START_WITH_WINDOWS));
                    break;
                }
                key.Close();
            }
        }
Пример #2
0
        public static void SaveTraySettings(TraySettingsType traySettingsType)
        {
            RegistryKey key = Registry.LocalMachine.CreateSubKey(APPLICATION_TRAY_REGISTRY_KEY);

            if (key != null)
            {
                switch (traySettingsType)
                {
                case TraySettingsType.TrayWindowVisibility:
                    key.SetValue("Tray Window Visible", TraySettings.WindowVisible.ToString());
                    break;

                case TraySettingsType.TrayStartupWithWindows:
                    key.SetValue("Start Tray With Windows", TraySettings.StartWithWindows.ToString());
                    break;
                }
                key.Close();
            }
        }
Пример #3
0
 public static void Save(TraySettingsType traySettingsType)
 {
     RegistryHandler.SaveTraySettings(traySettingsType);
 }
Пример #4
0
 public static void Load(TraySettingsType traySettingsType)
 {
     RegistryHandler.LoadTraySettings(traySettingsType);
 }