/// <summary> /// Default constructor of the package. /// Inside this method you can place any initialization code that does not require /// any Visual Studio service because at this point the package object is created but /// not sited yet inside Visual Studio environment. The place to do all the other /// initialization is the Initialize method. /// </summary> public CheckoutAndBuild2Package() { package = this; foreach (var attribute in GetType().GetAttributes <ProvideServiceAttribute>(false)) { ((IServiceContainer)this).AddService(attribute.Service, CreateServiceCallback, true); } InitCatalog(); }
public static void Notification(string message, NotificationType notificationType = NotificationType.Information, NotificationFlags flags = NotificationFlags.None, ICommand command = null, Guid id = default(Guid)) { if (!string.IsNullOrWhiteSpace(message)) { if (id == default(Guid)) { id = Guid.NewGuid(); } var explorer = CheckoutAndBuild2Package.GetGlobalService <ITeamExplorer>(); explorer.ShowNotification(message, notificationType, flags, command, id); } }
private string GenerateExternalScriptParts(bool generatePreCode, IOperationService currentService, IEnumerable <ISolutionProjectModel> solutions, IServiceSettings settings, ScriptExportType scriptExportType) { var builder = new StringBuilder(); foreach (var scriptGenerator in CheckoutAndBuild2Package.GetExportedValues <IScriptGenerator>()) { builder.AppendLine(generatePreCode ? scriptGenerator.GeneratePreScriptCode(currentService, solutions, settings, scriptExportType) : scriptGenerator.GeneratePostScriptCode(currentService, solutions, settings, scriptExportType)); } return(builder.ToString()); }
private static void ShowPropertyInspector(object obj) { if (obj is IEnumerable <ProjectViewModel> ) { VisualStudioTrackingSelection.UpdateSelectionTracking(((IEnumerable <ProjectViewModel>)obj).Select(model => model.OptionsObject).ToArray()); } else if (obj is ProjectViewModel) { VisualStudioTrackingSelection.UpdateSelectionTracking(((ProjectViewModel)obj).OptionsObject); } else if (obj != null) { VisualStudioTrackingSelection.UpdateSelectionTracking(obj); } var shell = CheckoutAndBuild2Package.GetGlobalService <IVsUIShell>(); Guid guidPropBrowser = new Guid(ToolWindowGuids.PropertyBrowser); IVsWindowFrame frameProperties; shell.FindToolWindow((uint)__VSFINDTOOLWIN.FTW_fForceCreate, ref guidPropBrowser, out frameProperties); frameProperties.Show(); }
private static void OpenSectionSettings(object param) { CheckoutAndBuild2Package.GetGlobalService <CheckoutAndBuild2Package>().ShowOptionPage(typeof(CheckoutAndBuildSectionOptionsPage)); }
private static T Get <T>() where T : class { return(CheckoutAndBuild2Package.GetGlobalService <T>()); }
/// <summary>Initializes a new instance of the <see cref="T:System.Object" /> class.</summary> public CheckoutAndBuildServiceProvider(CheckoutAndBuild2Package package, CompositionContainer mefContainer) { this.package = package; this.mefContainer = mefContainer; }
/// <summary> /// Initializes a new instance of the <see cref="T:System.Diagnostics.TraceListener"/> class. /// </summary> public VisualStudioOutputTraceListener() { logic = CheckoutAndBuild2Package.GetGlobalService <MainLogic>(); }
public static void HideNotification(Guid id) { TeamExplorerUtils.Instance.HideNotification(CheckoutAndBuild2Package.GetGlobalService <CheckoutAndBuild2Package>(), id); }