示例#1
0
        private void MasterSwitch(object sender, EventArgs e)
        {
            OleMenuCommand command = (OleMenuCommand)sender;
            Settings.Enabled = !command.Checked;

            if (!command.Checked) // Not checked means that it is checked.
            {
                Updater updater = new Updater(_repository, _manager);
                updater.CheckForUpdates();
            }
        }
        protected override void Initialize()
        {
            base.Initialize();

            var repository = (IVsExtensionRepository)GetService(typeof(SVsExtensionRepository));
            var manager = (IVsExtensionManager)GetService(typeof(SVsExtensionManager));
            var mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;

            if (repository == null || manager == null || mcs == null)
                return;

            Settings.Initialize(this);

            // Setup the menu buttons
            Commands commands = new Commands(repository, manager, mcs);
            commands.Initialize();

            // Check for extension updates
            Updater updater = new Updater(repository, manager);
            updater.CheckForUpdates();
        }