コード例 #1
0
        /// <summary>
        /// Initializes the singleton instance of the command.
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        public static async Task InitializeAsync(FsWorksheetPackage package)
        {
            // Switch to the main thread - the call to AddCommand in ReEvaluateCommand's constructor requires
            // the UI thread.
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken);

            OleMenuCommandService commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;

            Instance = new ReEvaluateCommand(package, commandService);
        }
コード例 #2
0
 public FsWorksheetPackage()
 {
     Instance = this;
 }