Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@618 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
9 changed files with 60 additions and 36 deletions
@ -0,0 +1,35 @@ |
|||||||
|
// <file> |
||||||
|
// <copyright see="prj:///doc/copyright.txt">2005 AlphaSierraPapa</copyright> |
||||||
|
// <license see="prj:///doc/license.txt">GNU General Public License</license> |
||||||
|
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/> |
||||||
|
// <version>$Revision$</version> |
||||||
|
// </file> |
||||||
|
|
||||||
|
namespace Boo.InterpreterAddIn |
||||||
|
|
||||||
|
import System |
||||||
|
import System.Windows.Forms |
||||||
|
|
||||||
|
class InterpreterWrapper: |
||||||
|
_interpreter as Boo.Lang.Interpreter.InteractiveInterpreter |
||||||
|
|
||||||
|
def constructor(): |
||||||
|
_interpreter = Boo.Lang.Interpreter.InteractiveInterpreter( |
||||||
|
RememberLastValue: true, |
||||||
|
Print: self.OnPrintLine) |
||||||
|
_interpreter.SetValue("cls", { Cleared() }) |
||||||
|
|
||||||
|
event LinePrinted as callable(string) |
||||||
|
event Cleared as MethodInvoker |
||||||
|
|
||||||
|
private def OnPrintLine(text as string): |
||||||
|
LinePrinted(text) |
||||||
|
|
||||||
|
def RunCommand(code as string): |
||||||
|
_interpreter.LoopEval(code) |
||||||
|
|
||||||
|
def SuggestCodeCompletion(code as string): |
||||||
|
// David: the code completion items have to be passed as strings; |
||||||
|
// but it's not important, you can return null if you want. |
||||||
|
return _interpreter.SuggestCodeCompletion(code) |
||||||
|
|
Loading…
Reference in new issue