private void UpdateDebuggerState() { var position = _interpreter?.Position ?? Place.Empty; EditrVM.RunnningPosition = position; MemoryVM.SetMemory(_interpreter?.GetEditableMemory()); if (position.IsEmpty() == false) { EditrVM.ForcusAt(position); } }
public IActionResult Memory() { MemoryVM model = new MemoryVM(); CPMemory Item1 = new CPMemory(); Item1.ItemTitle = "Item 1 Title Goes Here"; Item1.ItemLink = "View Item Details"; Item1.MiniDescription.Add("UPC:xxxxxxxxx"); Item1.MiniDescription.Add("Bullet goes here"); Item1.MiniDescription.Add("Bullet goes here"); Item1.MiniDescription.Add("Bullet goes here"); Item1.MiniDescription.Add("Bullet goes here"); model.MemoryItems.Add(Item1); return(View(model)); }
private bool InitializiedInterpretor() { var(hash, code) = EditrVM.GetSourceCode(); try { var ret = true; if (_interpreter == null || _interpreter.IsStopped()) { _sourceCodeHash = hash; _interpreter = new Interpreter.Interpreter(code) { }; _interpreter.TryReadChar += TextImputDataVM.GetTextSender().TryGetNextChar; _interpreter.WriteChar += ResultTextVM.WriteChar; ResultTextVM.Clear(); } else { if (_sourceCodeHash != hash) { ret &= _interpreter.TryForceUpdateSourceCode(code, EditrVM.RunnningPosition); } else { ret &= _interpreter.TryForceUpdateRunnningPosition(EditrVM.RunnningPosition); } MemoryVM.ReflectToInterpretor(); } _interpreter.BreakPoints = EditrVM.GetBreakPoints(); return(ret); } catch (Exception exe) { MessageBox.Show(exe.Message); return(false); } finally { _sourceCodeHash = hash; } }