void AutoIncrementVsixVersion(EnvDTE.Project project) { ThreadHelper.ThrowIfNotOnUIThread(); var projItems = project.ProjectItems; for (int i = projItems.Count; i > 0; i--) { var item = projItems.Item(i); if (item.Name.EndsWith(".vsixmanifest", StringComparison.OrdinalIgnoreCase)) { if (item.IsOpen && item.IsDirty) { item.Document.NewWindow().Activate(); CodistPackage.ShowMessageBox(item.Name + " is open and modified. Auto increment VSIX version number failed.", nameof(Codist), true); } else if (Commands.IncrementVsixVersionCommand.IncrementVersion(item, out var message)) { var output = _Package.GetOutputPane(VSConstants.OutputWindowPaneGuid.BuildOutputPane_guid, "Build"); output?.OutputString(nameof(Codist) + ": " + message + Environment.NewLine); } else { CodistPackage.ShowMessageBox(message, "Auto increment VSIX version number failed.", true); } break; } } }
internal BuildEvents(CodistPackage package) { ThreadHelper.ThrowIfNotOnUIThread(".ctor"); ServicesHelper.Get <IVsSolutionBuildManager, SVsSolutionBuildManager>().AdviseUpdateSolutionEvents(this, out _); _Package = package; }