示例#1
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            config.FeedConfig.Feed        = txtFeed.Text;
            config.FeedConfig.PublicKey   = txtKey.Text;
            config.AreReferencesIncluded  = chkReferences.IsChecked ?? false;
            config.AreSymbolsIncluded     = chkSymbols.IsChecked ?? false;
            config.UseDefaultOutput       = chkOutput.IsChecked ?? false;
            config.DefaultOutputDirectory = txtDir.Text;
            config.IsBuildEnabled         = chkBuild.IsChecked ?? false;

            try
            {
                NuGetConfigurator.SaveConfig(config);

                VsShellUtilities.ShowMessageBox(
                    serviceProvider,
                    "Config saved.",
                    "Configure NuGetTools",
                    OLEMSGICON.OLEMSGICON_INFO,
                    OLEMSGBUTTON.OLEMSGBUTTON_OK,
                    OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);

                Close();
            }
            catch (Exception ex)
            {
                VsShellUtilities.ShowMessageBox(
                    serviceProvider,
                    "Could not save config." + Environment.NewLine + ex.Message,
                    "Configure NuGetTools",
                    OLEMSGICON.OLEMSGICON_INFO,
                    OLEMSGBUTTON.OLEMSGBUTTON_OK,
                    OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);
            }
        }
示例#2
0
 // Use this constructor for minimize and maximize buttons and no F1 Help.
 public VersionDialog(IServiceProvider serviceProvider)
 {
     this.HasMaximizeButton = false;
     this.HasMinimizeButton = false;
     this.serviceProvider   = serviceProvider;
     InitializeComponent();
     config = NuGetConfigurator.LoadConfig();
     WindowStartupLocation = WindowStartupLocation.CenterScreen;
 }
        public NuGetCommands(IOutput output)
        {
            LastCreatedFile                    = null;
            this.config                        = NuGetConfigurator.LoadConfig();
            processInfo.FileName               = $@"{NuGetToolsPackage.ExtensionPath}\Resources\nuget.exe";
            processInfo.UseShellExecute        = false;
            processInfo.RedirectStandardOutput = true;
            processInfo.RedirectStandardError  = true;
            processInfo.CreateNoWindow         = true;

            this.output = output;
        }