Beispiel #1
0
        /// <summary>
        /// Initializes the singleton instance of the command.
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        public static async Task InitializeAsync(AsyncPackage package, IMenuCommandService inCommandService, MonoVisualStudioExtension monoVisualStudioExtension)
        {
            // Switch to the main thread - the call to AddCommand in AttachToEngineCommand's constructor requires
            // the UI thread.
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken);

            OleMenuCommandService commandService = inCommandService as OleMenuCommandService;
            Project   monoProject       = monoVisualStudioExtension.GetStartupProject();
            CommandID dynamicItemRootId = new CommandID(new Guid(guidDynamicMenuPackageCmdSet), (int)0x1030);

            if (monoProject == null || !monoProject.Name.Contains("UnrealEngine"))
            {
                return;
            }
            Instance = new AttachToEngineCommand(package, commandService);
            Instance.MonoExtension = monoVisualStudioExtension;
        }