Пример #1
0
        public static async Task InitializeAsync(PsuedoLocPackage package)
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

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

            Instance = new DiacriticsCommand(package, commandService);
        }
Пример #2
0
        public static async Task InitializeAsync(PsuedoLocPackage package)
        {
            // Verify the current thread is the UI thread - the call to AddCommand in DoubleCommand's constructor requires
            // the UI thread.
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

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

            Instance = new L337Command(package, commandService);
        }
Пример #3
0
        private L337Command(PsuedoLocPackage package, OleMenuCommandService commandService)
            : base(package)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            commandService = commandService ?? throw new ArgumentNullException(nameof(commandService));

            var menuCommandId = new CommandID(PsuedoLocPackage.CommandSet, CommandId);
            var menuItem      = new OleMenuCommand(this.Execute, menuCommandId);

            menuItem.BeforeQueryStatus += this.MenuItem_BeforeQueryStatus;
            commandService.AddCommand(menuItem);
        }
Пример #4
0
#pragma warning restore SA1401 // Fields must be private

        public BaseCommand(PsuedoLocPackage package)
        {
            this.package = package ?? throw new ArgumentNullException(nameof(package));
        }
Пример #5
0
 protected ReversableCommand(PsuedoLocPackage package)
     : base(package)
 {
 }