Example #1
0
        public override void LoadSettingsFromStorage()
        {
            DeletingALineDeletesTheBookmark = LoadBooleanProperty("DeletingALineDeletesTheBookmark", true);
            ShowMenuOption = (ShowMenuOption)LoadIntProperty("ShowMenuOption", (int)ShowMenuOption.WithTitleSuperBookmarks);
            NavigateInFolderIncludesSubfolders  = LoadBooleanProperty("NavigateInFolderIncludesSubfolders", true);
            DeleteAllInFolderIncludesSubfolders = LoadBooleanProperty("DeleteAllInFolderIncludesSubfolders", false);
            MergeWhenImporting = LoadBooleanProperty("MergeWhenImporting", false);

            var glypColorRgb = LoadIntProperty("GlyphColor", BookmarkGlyphFactory.DefaultColor.ToArgb());

            GlyphColor = Color.FromArgb(glypColorRgb);
            BookmarkGlyphFactory.SetGlyphColor(GlyphColor);

            var customColorsRgbs = LoadStringProperty("CustomColors", null);

            CustomColors = customColorsRgbs?.Split(',').Select(rgb => int.Parse(rgb)).ToArray();
        }
Example #2
0
        private void InitializeOptionsStorage()
        {
            Options             = (GeneralOptionsPage)GetDialogPage(typeof(GeneralOptionsPage));
            StorageOptions      = (StorageOptionsPage)GetDialogPage(typeof(StorageOptionsPage));
            ConfirmationOptions = (ConfirmationsPage)GetDialogPage(typeof(ConfirmationsPage));
            DebugOptions        = (DebugPage)GetDialogPage(typeof(DebugPage));

            Options.GlyphColorChanged += (sender, args) =>
            {
                BookmarkGlyphFactory.SetGlyphColor(Options.GlyphColor);

                //Force redraw of currently visible bookmarks
                //(there must be a better way to do this...)
                if (CurrentWindowFrame?.IsVisible() == VSConstants.S_OK)
                {
                    CurrentWindowFrame.Hide();
                    CurrentWindowFrame.Show();
                }
            };

            Options.ShowMenuOptionChanged += (sender, args) => UpdateMenuVisibilityAndText();
        }