Ejemplo n.º 1
0
 /// <summary>
 /// Saves all the settings in BESettings inside the parent registry Software\BExplorer
 /// </summary>
 public static void SaveSettings()
 {
     using (RegistryKey rk = Registry.CurrentUser, rks = rk.OpenSubKey(@"Software\BExplorer", true)) {
         rks.SetValue("StartUpLoc", StartupLocation);
         rks.SetValue("CheckForUpdates", IsUpdateCheck);
         rks.SetValue("CheckInterval", UpdateCheckInterval);
         rks.SetValue("CheckForUpdatesStartup", IsUpdateCheckStartup);
         rks.SetValue("UpdateCheckType", UpdateCheckType);
         rks.SetValue("IsConsoleShown", IsConsoleShown);
         rks.SetValue("EnableActionLog", EnableActionLog);
         rks.SetValue("IsGlassOnRibonMinimized", IsGlassOnRibonMinimized);
         rks.SetValue("LastUpdateCheck", LastUpdateCheck.ToBinary(), RegistryValueKind.QWord);
         rks.SetValue("InfoPaneHeight", InfoPaneHeight, RegistryValueKind.DWord);
         rks.SetValue("CurrentTheme", CurrentTheme);
         rks.SetValue("PreviewPaneEnabled", IsPreviewPaneEnabled);
         rks.SetValue("InfoPaneEnabled", IsInfoPaneEnabled);
         rks.SetValue("IsTraditionalNameGrouping", IsTraditionalNameGrouping);
         rks.SetValue("Locale", Locale);
         rks.SetValue("IsRestoreTabs", IsRestoreTabs);
         rks.SetValue("InfoPaneHeight", InfoPaneHeight);
         rks.SetValue("NavigationPaneEnabled", IsNavigationPaneEnabled);
         rks.SetValue("FileOpExEnabled", IsFileOpExEnabled);
         rks.SetValue("IsCustomFO", IsCustomFO);
         rks.SetValue("SearchBarWidth", SearchBarWidth);
         rks.SetValue("OverwriteImageWhileEditing", OverwriteImageWhileEditing);
         rks.SetValue("SavedTabsDirectory", SavedTabsDirectory);
         rks.SetValue("OpenedTabs", OpenedTabs);
         rks.SetValue("LastWindowWidth", LastWindowWidth);
         rks.SetValue("LastWindowHeight", LastWindowHeight);
         rks.SetValue("LastWindowPosLeft", LastWindowPosLeft);
         rks.SetValue("LastWindowPosTop", LastWindowPosTop);
         rks.SetValue("LastWindowState", LastWindowState);
         rks.SetValue("IsRibonMinimized", IsRibonMinimized);
         rks.SetValue("OpenedTabs", OpenedTabs);
         rks.SetValue("RTLMode", RTLMode);
         rks.SetValue("AutoSwitchFolderTools", AutoSwitchFolderTools);
         rks.SetValue("AutoSwitchArchiveTools", AutoSwitchArchiveTools);
         rks.SetValue("AutoSwitchImageTools", AutoSwitchImageTools);
         rks.SetValue("AutoSwitchApplicationTools", AutoSwitchApplicationTools);
         rks.SetValue("AutoSwitchLibraryTools", AutoSwitchLibraryTools);
         rks.SetValue("AutoSwitchDriveTools", AutoSwitchDriveTools);
         rks.SetValue("AutoSwitchVirtualDriveTools", AutoSwitchVirtualDriveTools);
         rks.SetValue("ShowCheckboxes", ShowCheckboxes);
         rks.SetValue("CmdWinHeight", CmdWinHeight);
         rks.SetValue("TabBarAlignment", TabBarAlignment);
         rks.SetValue("HFlyoutEnabled", HFlyoutEnabled);
         rks.SetValue("PreviewPaneWidth", PreviewPaneWidth);
         rks.SetValue("NavigateParentWithDblClickEmpty", NavigateParentWithDblClickEmpty);
     }
 } //TODO: Make sure you only use this 1 time when the application closes OR when a new instance is opened
Ejemplo n.º 2
0
        public static void Save()
        {
            using (BinaryWriter binWriter = new BinaryWriter(File.Create(SettingsFile)))
            {
                binWriter.Write("WINBMACFG".ToCharArray());
                binWriter.Write(4);
                binWriter.Write(Authenticators.Count);

                foreach (AuthAPI.Authenticator auth in Authenticators)
                {
                    if (auth.Name != null)
                    {
                        binWriter.Write(auth.Name);
                    }
                    else
                    {
                        binWriter.Write("");
                    }

                    binWriter.Write(auth.Serial);
                    binWriter.Write(auth.IsRestoreSupported);
                    binWriter.Write((byte)auth.EncryptionType);
                    binWriter.Write(auth.Token.Length);
                    binWriter.Write(auth.Token);
                }

                binWriter.Write(LastSyncTime.ToBinary());
                binWriter.Write(ServerTimeOffset);
                binWriter.Write(SelectedAuthenticatorIndex);
                binWriter.Write(AutoSyncTime);
                binWriter.Write(AlwaysOnTop);
                binWriter.Write(AutoCopyToClipboard);
                binWriter.Write(Theme);
                binWriter.Write(CheckForUpdates);
                binWriter.Write(LastUpdateCheck.ToBinary());

                binWriter.Write(IsHotkeyEnabled);
                binWriter.Write((byte)HotkeyModifiers);
                binWriter.Write((int)Hotkey);
            }
        }