Example #1
0
        protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            await JoinableTaskFactory.SwitchToMainThreadAsync();

            _dte = await GetServiceAsync(typeof(DTE)) as DTE2;

            Assumes.Present(_dte);

            _cache = new CommandTable(_dte);
            OutputWindowTraceListener.Register(Vsix.Name, nameof(VoiceExtension));

            //Telemetry.Initialize(this, Vsix.Version, "c18e8661-f6e6-466d-b968-a6c128506bf4");

            InitializeSpeechRecognition();

            // Setup listening command
            var mcs = await GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;

            Assumes.Present(mcs);

            var cmd  = new CommandID(PackageGuids.guidVoiceExtensionCmdSet, PackageIds.cmdidMyCommand);
            var menu = new MenuCommand(OnListening, cmd);

            mcs.AddCommand(menu);
        }
        protected override void Initialize()
        {
            _dte = GetService(typeof(DTE)) as DTE2;
            _cache = new CommandTable(_dte);
            InitializeSpeechRecognition();

            // Setup listening command
            OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            CommandID cmd = new CommandID(GuidList.guidVoiceExtensionCmdSet, (int)PkgCmdIDList.cmdidMyCommand);
            MenuCommand menu = new MenuCommand(OnListening, cmd);
            mcs.AddCommand(menu);
        }
        protected override void Initialize()
        {
            _dte   = GetService(typeof(DTE)) as DTE2;
            _cache = new CommandTable(_dte);
            InitializeSpeechRecognition();

            // Setup listening command
            OleMenuCommandService mcs  = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            CommandID             cmd  = new CommandID(GuidList.guidVoiceExtensionCmdSet, (int)PkgCmdIDList.cmdidMyCommand);
            MenuCommand           menu = new MenuCommand(OnListening, cmd);

            mcs.AddCommand(menu);
        }
Example #4
0
        protected override void Initialize()
        {
            _dte   = GetService(typeof(DTE)) as DTE2;
            _cache = new CommandTable(_dte);

            Logger.Initialize(this, Vsix.Name);
            Telemetry.Initialize(this, Vsix.Version, "c18e8661-f6e6-466d-b968-a6c128506bf4");

            InitializeSpeechRecognition();

            // Setup listening command
            var mcs  = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            var cmd  = new CommandID(PackageGuids.guidVoiceExtensionCmdSet, PackageIds.cmdidMyCommand);
            var menu = new MenuCommand(OnListening, cmd);

            mcs.AddCommand(menu);
        }