private void PromptAndBrowse(Version latestVersion)
        {
            var prompt = string.Format(RubberduckUI.VersionCheck_NewVersionAvailable, latestVersion);

            if (!_prompt.Question(prompt, RubberduckUI.Rubberduck))
            {
                return;
            }

            _process.Start("https://github.com/rubberduck-vba/Rubberduck/releases/latest");
        }
Ejemplo n.º 2
0
        private void PromptAndBrowse(Version latestVersion, bool includePreRelease)
        {
            var buildType = includePreRelease
                ? RubberduckUI.VersionCheck_BuildType_PreRelease
                : RubberduckUI.VersionCheck_BuildType_Release;
            var prompt = string.Format(RubberduckUI.VersionCheck_NewVersionAvailable, _versionCheck.CurrentVersion, latestVersion, buildType);

            if (!_prompt.Question(prompt, RubberduckUI.Rubberduck))
            {
                return;
            }

            var url = includePreRelease
                ? "https://github.com/rubberduck-vba/Rubberduck/releases"
                : "https://github.com/rubberduck-vba/Rubberduck/releases/latest";

            _process.Start(url);
        }
        private bool PromptIfMethodImplementsInterface(Declaration targetVariable)
        {
            var functionDeclaration = (ModuleBodyElementDeclaration)_declarations.FindTarget(targetVariable.QualifiedSelection, ValidDeclarationTypes);

            if (functionDeclaration == null || !functionDeclaration.IsInterfaceImplementation)
            {
                return(true);
            }

            var interfaceImplementation = functionDeclaration.InterfaceMemberImplemented;

            if (interfaceImplementation == null)
            {
                return(true);
            }

            var message = string.Format(RubberduckUI.IntroduceParameter_PromptIfTargetIsInterface,
                                        functionDeclaration.IdentifierName, interfaceImplementation.ComponentName,
                                        interfaceImplementation.IdentifierName);

            return(_messageBox.Question(message, RubberduckUI.IntroduceParameter_Caption));
        }
Ejemplo n.º 4
0
 private void CheckForLegacyIndenterSettings()
 {
     try
     {
         Logger.Trace("Checking for legacy Smart Indenter settings.");
         if (_config.UserSettings.GeneralSettings.IsSmartIndenterPrompted ||
             !_config.UserSettings.IndenterSettings.LegacySettingsExist())
         {
             return;
         }
         if (_messageBox.Question(Resources.RubberduckUI.SmartIndenter_LegacySettingPrompt, "Rubberduck"))
         {
             Logger.Trace("Attempting to load legacy Smart Indenter settings.");
             _config.UserSettings.IndenterSettings.LoadLegacyFromRegistry();
         }
         _config.UserSettings.GeneralSettings.IsSmartIndenterPrompted = true;
         _configService.Save(_config);
     }
     catch
     {
         //Meh.
     }
 }