static ImagePreviewToolTipSettings()
        {
            var settingsManager = new ShellSettingsManager(ServiceProvider.GlobalProvider);

            settingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);
            Current       = new ImagePreviewToolTipSettings();
            LoadCurrent();
        }
Ejemplo n.º 2
0
        protected override void Initialize()
        {
            base.Initialize();

            var mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;

            if (mcs == null)
            {
                return;
            }

            {
                CommandID   menuCommandID = new CommandID(GuidList.guidImagePreviewToolTipCmdSet, (int)PkgCmdIDList.cmdidToggleImagePreviewToolTip);
                MenuCommand menuItem      = new MenuCommand((sender, e) =>
                {
                    ImagePreviewToolTipSettings.Current.IsEnabled = !ImagePreviewToolTipSettings.Current.IsEnabled;
                    ImagePreviewToolTipSettings.SaveCurrent();
                    MessageBox.Show(string.Format("ImagePreviewToolTip is {0}.", (ImagePreviewToolTipSettings.Current.IsEnabled ? "enabled" : "disabled")));
                }, menuCommandID);
                mcs.AddCommand(menuItem);
            }
        }