/// <summary> /// Initialization of the package. /// </summary> protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); //await base.InitializeAsync(cancellationToken, progress); dte = await GetServiceAsync(typeof(DTE)) as DTE2; //GetGlobalService(typeof(DTE)) as DTE2; sln_mgr = await GetServiceAsync(typeof(SVsSolution)) as IVsSolution2; UpdateUnrealLoadedStatus(); sln_mgr.AdviseSolutionEvents(this, out SolutionEventsHandle); build_mgr = await GetServiceAsync(typeof(SVsSolutionBuildManager)) as IVsSolutionBuildManager2; KUE4VS.ExtContext.Instance = this; PackageProvider.Pkg = this; UE4PropVis.Config.Instance = (UE4PropVis.Config)GetDialogPage(typeof(UE4PropVis.Config)); AddNewSourceFileCmd.Initialize(this); AddNewClassCmd.Initialize(this); AddNewModuleCmd.Initialize(this); AddNewPluginCmd.Initialize(this); AddCodeElementWindowCommand.Initialize(this); base.Initialize(); }
/// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initialization code that rely on services provided by VisualStudio. /// </summary> protected override void Initialize() { base.Initialize(); KUE4VS.Logging.Initialize(ExtensionName, VersionString); KUE4VS.Logging.WriteLine("Loading UnrealVS extension package..."); dte = GetGlobalService(typeof(DTE)) as DTE2; sln_mgr = ServiceProvider.GlobalProvider.GetService(typeof(SVsSolution)) as IVsSolution2; sln_mgr.AdviseSolutionEvents(this, out SolutionEventsHandle); build_mgr = ServiceProvider.GlobalProvider.GetService(typeof(SVsSolutionBuildManager)) as IVsSolutionBuildManager2; KUE4VS.ExtContext.Instance = this; PackageProvider.Pkg = this; UE4PropVis.Config.Instance = (UE4PropVis.Config)GetDialogPage(typeof(UE4PropVis.Config)); UpdateUnrealLoadedStatus(); AddNewSourceFileCmd.Initialize(this); AddNewClassCmd.Initialize(this); AddNewModuleCmd.Initialize(this); AddNewPluginCmd.Initialize(this); AddCodeElementWindowCommand.Initialize(this); }
/// <summary> /// Initializes the singleton instance of the command. /// </summary> /// <param name="package">Owner package, not null.</param> public static void Initialize(Package package) { Instance = new AddCodeElementWindowCommand(package); }