Esempio n. 1
0
        private CommandLineRepl(CommandLineReplPackage package)
        {
            if (package == null)
            {
                throw new ArgumentNullException("package");
            }

            this.package = package;

            outputPane      = new OutputPane(package, Microsoft.VisualStudio.VSConstants.OutputWindowPaneGuid.GeneralPane_guid);
            lastOutputPane  = new OutputPane(package, Microsoft.VisualStudio.VSConstants.OutputWindowPaneGuid.DebugPane_guid);
            this.editorText = new EditorText(package, package);

            OleMenuCommandService commandService = this.ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;

            if (commandService != null)
            {
                var menuCommandID = new CommandID(CommandSet, CommandId);
                var menuItem      = new MenuCommand(this.MenuItemCallback, menuCommandID);
                commandService.AddCommand(menuItem);

                redirect = new ConsoleRedirect("cmd", "/k echo type some commands e.g. (dir, cd, help, etc... :)", this.ServiceProvider);
                redirect.ReceivedOutput += new ReceivedOutputEventHandler(outputPane.OutputString);
                redirect.ReceivedOutput += new ReceivedOutputEventHandler(lastOutputPane.OutputString);
                redirect.Start();
            }
        }
Esempio n. 2
0
 public static void Initialize(CommandLineReplPackage package)
 {
     Instance = new CommandLineRepl(package);
 }