コード例 #1
0
        public override void DoCommand(object sender, EventArgs args)
        {
            var window = ExecuteInReplCommand.EnsureReplWindow();

            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;

            ErrorHandler.ThrowOnFailure(windowFrame.Show());
            ((IReplWindow)window).Focus();
        }
コード例 #2
0
        public override void DoCommand(object sender, EventArgs args)
        {
            ToolWindowPane window = ExecuteInReplCommand.EnsureReplWindow();

            IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame;

            ErrorHandler.ThrowOnFailure(windowFrame.Show());

            var activeView = CommonPackage.GetActiveTextView();

            foreach (var span in activeView.Selection.SelectedSpans)
            {
                var text = span.GetText();
                ((IReplWindow)window).PasteText(text);
            }

            ((IReplWindow)window).Focus();
        }
コード例 #3
0
        public override void DoCommand(object sender, EventArgs args)
        {
            var window     = ExecuteInReplCommand.EnsureReplWindow();
            var eval       = window.Evaluator as RemotePythonEvaluator;
            var activeView = IronPythonToolsPackage.GetActiveTextView();

            string path = activeView.GetFilePath();

            if (path != null)
            {
                var scope = eval.Engine.GetScope(path);
                if (scope != null)
                {
                    // we're now in the correct module, execute the code
                    string scopeName = eval.SetScope(scope);
                    window.Cancel();
                    if (scopeName != String.Empty)
                    {
                        window.WriteLine(eval.Prompt + " %module " + scopeName);
                        window.WriteLine(String.Format("Current scope changed to {0}", scopeName));
                    }
                    else
                    {
                        window.WriteLine(eval.Prompt + " %module (unknown name)");
                        window.WriteLine("Current scope changed to (unknown name)");
                    }

                    base.DoCommand(sender, args);
                }
                else
                {
                    window.WriteLine(String.Format("Could not find module: {0}", path));
                }
            }
            else
            {
                window.WriteLine("Could not find module");
            }
        }
コード例 #4
0
 public ExecuteInReplCommand()
 {
     Instance = this;
 }
コード例 #5
0
 public ExecuteInReplCommand()
 {
     Instance = this;
 }