///<summary> /// Sets up the app before running any other code /// </summary> public static void Startup() { if (!IsStarted) { lock (_syncLock) { if (!IsStarted) { AssemblyBindingRedirectHelper.ConfigureBindingRedirects(); IsStarted = true; } } } }
protected override void Initialize() { base.Initialize(); _dte2 = GetService(typeof(DTE)) as DTE2; if (_dte2 == null) { return; } var oleMenuCommandService = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; if (oleMenuCommandService != null) { var menuCommandId5 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidReverseEngineerCodeFirst); var menuItem5 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId5); oleMenuCommandService.AddCommand(menuItem5); var menuCommandId6 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidDebugView); var menuItem6 = new OleMenuCommand(OnItemContextMenuInvokeHandler, null, OnItemMenuBeforeQueryStatus, menuCommandId6); oleMenuCommandService.AddCommand(menuItem6); var menuCommandId7 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidAbout); var menuItem7 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId7); oleMenuCommandService.AddCommand(menuItem7); var menuCommandId8 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidDgmlView); var menuItem8 = new OleMenuCommand(OnItemContextMenuInvokeHandler, null, OnItemMenuBeforeQueryStatus, menuCommandId8); oleMenuCommandService.AddCommand(menuItem8); var menuCommandId9 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidEdmMenuAbout); var menuItem9 = new OleMenuCommand(OnItemContextMenuInvokeHandler, null, OnItemMenuBeforeQueryStatus, menuCommandId9); oleMenuCommandService.AddCommand(menuItem9); } AssemblyBindingRedirectHelper.ConfigureBindingRedirects(); }
protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { await base.InitializeAsync(cancellationToken, progress); _dte2 = await GetServiceAsync(typeof(DTE)) as DTE2; if (_dte2 == null) { return; } var oleMenuCommandService = await GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService; AssemblyBindingRedirectHelper.ConfigureBindingRedirects(); await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); if (oleMenuCommandService != null) { var menuCommandId3 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidDgmlBuild); var menuItem3 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId3); oleMenuCommandService.AddCommand(menuItem3); var menuCommandId4 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidReverseEngineerDgml); var menuItem4 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId4); oleMenuCommandService.AddCommand(menuItem4); var menuCommandId5 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidReverseEngineerCodeFirst); var menuItem5 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId5); oleMenuCommandService.AddCommand(menuItem5); var menuCommandId7 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidAbout); var menuItem7 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId7); oleMenuCommandService.AddCommand(menuItem7); var menuCommandId8 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidDgmlNuget); var menuItem8 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId8); oleMenuCommandService.AddCommand(menuItem8); var menuCommandId9 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidSqlBuild); var menuItem9 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId9); oleMenuCommandService.AddCommand(menuItem9); var menuCommandId10 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidDebugViewBuild); var menuItem10 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId10); oleMenuCommandService.AddCommand(menuItem10); var menuCommandId11 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidMigrationStatus); var menuItem11 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId11); oleMenuCommandService.AddCommand(menuItem11); } typeof(Microsoft.Xaml.Behaviors.Behavior).ToString(); typeof(Microsoft.VisualStudio.ProjectSystem.ProjectCapabilities).ToString(); }
protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { await base.InitializeAsync(cancellationToken, progress); _dte2 = await ServiceProvider.GetGlobalServiceAsync <DTE, DTE2>(); if (_dte2 == null) { return; } var oleMenuCommandService = await ServiceProvider.GetGlobalServiceAsync <IMenuCommandService, OleMenuCommandService>(); AssemblyBindingRedirectHelper.ConfigureBindingRedirects(); await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); if (oleMenuCommandService != null) { var menuCommandId3 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidDgmlBuild); var menuItem3 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId3); oleMenuCommandService.AddCommand(menuItem3); var menuCommandId4 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidReverseEngineerDgml); var menuItem4 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId4); oleMenuCommandService.AddCommand(menuItem4); var menuCommandId5 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidReverseEngineerCodeFirst); var menuItem5 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId5); oleMenuCommandService.AddCommand(menuItem5); var menuCommandId7 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidAbout); var menuItem7 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId7); oleMenuCommandService.AddCommand(menuItem7); var menuCommandId8 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidDgmlNuget); var menuItem8 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId8); oleMenuCommandService.AddCommand(menuItem8); var menuCommandId9 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidSqlBuild); var menuItem9 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId9); oleMenuCommandService.AddCommand(menuItem9); var menuCommandId10 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidDebugViewBuild); var menuItem10 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId10); oleMenuCommandService.AddCommand(menuItem10); } }
protected override void Initialize() { base.Initialize(); _dte2 = GetService(typeof(DTE)) as DTE2; if (_dte2 == null) { return; } var oleMenuCommandService = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; if (oleMenuCommandService != null) { var menuCommandId3 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidDgmlBuild); var menuItem3 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId3); oleMenuCommandService.AddCommand(menuItem3); var menuCommandId4 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidReverseEngineerDgml); var menuItem4 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId4); oleMenuCommandService.AddCommand(menuItem4); var menuCommandId5 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidReverseEngineerCodeFirst); var menuItem5 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId5); oleMenuCommandService.AddCommand(menuItem5); var menuCommandId7 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidAbout); var menuItem7 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId7); oleMenuCommandService.AddCommand(menuItem7); var menuCommandId8 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidDgmlNuget); var menuItem8 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId8); oleMenuCommandService.AddCommand(menuItem8); var menuCommandId9 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidSqlBuild); var menuItem9 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId9); oleMenuCommandService.AddCommand(menuItem9); var menuCommandId10 = new CommandID(GuidList.guidDbContextPackageCmdSet, (int)PkgCmdIDList.cmdidDebugViewBuild); var menuItem10 = new OleMenuCommand(OnProjectContextMenuInvokeHandler, null, OnProjectMenuBeforeQueryStatus, menuCommandId10); oleMenuCommandService.AddCommand(menuItem10); } AssemblyBindingRedirectHelper.ConfigureBindingRedirects(); //Boot Telemetry Telemetry.Enabled = false; if (Telemetry.Enabled) { Telemetry.Initialize(Dte2, Assembly.GetExecutingAssembly().GetName().Version.ToString(), VisualStudioVersion.ToString(), "d4881a82-2247-42c9-9272-f7bc8aa29315"); } Telemetry.TrackEvent("Platform: Visual Studio " + VisualStudioVersion.ToString(1)); }