Exemplo n.º 1
0
        public DebuggerViewModel
            (DocumentModel document,
            DebugDocumentModel debugDocumentModel,
            ConsoleModel console,
            DebuggerModel debugger,
            object currentView,
            EditorView editorView,
            EditorDebugView editorDebugView,
            DebuggerFlagsModel debuggerFlags)
        {
            Debugger      = debugger;
            Console       = console;
            Document      = document;
            DebugDocument = debugDocumentModel;
            DebuggerFlags = debuggerFlags;

            _currentView     = currentView;
            _editorView      = editorView;
            _editorDebugView = editorDebugView;

            _isTaskRunning           = false;
            IsTaskWaitingForInput    = false;
            IsDebuggingMode          = false;
            _cancellationTokenSource = new CancellationTokenSource();

            RunInterpreterCommand  = new RelayCommand(RunInterpreter, () => !_isTaskRunning && !string.IsNullOrEmpty(Document.Text) && !IsDebuggingMode);
            SendInputCommand       = new RelayCommand(SendInput, () => IsTaskWaitingForInput);
            EndCurrentTaskCommand  = new RelayCommand(EndCurrentInterpreterTask, () => _isTaskRunning || IsDebuggingMode);
            NextInstructionCommand = new RelayCommand(NextInstruction, () => !string.IsNullOrEmpty(Document.Text) && !_isTaskRunning);
        }
Exemplo n.º 2
0
        public void Initialize()
        {
            _document           = new DocumentModel();
            _debugger           = new DebuggerModel();
            _console            = new ConsoleModel();
            _debugDocumentModel = new DebugDocumentModel();
            _debuggerFlags      = new DebuggerFlagsModel();
            _editorView         = null;
            _editorDebugView    = null;
            _currentView        = _editorView;

            _debuggerViewModel = new DebuggerViewModel(_document, _debugDocumentModel, _console, _debugger, _currentView, _editorView, _editorDebugView, _debuggerFlags);
        }
        public MainViewModel()
        {
            _document           = new DocumentModel();
            _debuggerModel      = new DebuggerModel();
            _console            = new ConsoleModel();
            _debugDocumentModel = new DebugDocumentModel();
            _replaceModel       = new ReplaceModel();
            _compilerFlags      = new CompilerFlagsModel();
            _debuggerFlags      = new DebuggerFlagsModel();

            _editorView      = new EditorView();
            _editorDebugView = new EditorDebugView();
            _currentView     = _editorView;

            Editor     = new EditorViewModel(_document);
            File       = new FileViewModel(_document);
            Help       = new HelpViewModel();
            Debugger   = new DebuggerViewModel(_document, _debugDocumentModel, _console, _debuggerModel, _currentView, _editorView, _editorDebugView, _debuggerFlags);
            Compiler   = new CompilerViewModel(_document, _console, _compilerFlags);
            MainWindow = new MainWindowViewModel();
            Replace    = new ReplaceViewModel(_replaceModel, _document);
        }