Exemplo n.º 1
0
        public string ExecuteMemoryCommand(MemoryCommand cmd)
        {
            number = converter.ConvertBaseTo10(number.systemBase, editor.number);
            switch (cmd)
            {
            case MemoryCommand.add:
                memory.Add(number);
                break;

            case MemoryCommand.sub:
                memory.Sub(number);
                break;

            case MemoryCommand.clear:
                memory.Clear(number);
                break;

            case MemoryCommand.read:
                number = memory.ReadNumber(number);
                break;

            case MemoryCommand.write:
                memory.Write(number);
                break;

            default:
                break;
            }
            editor.number = converter.Convert10ToBase(number.systemBase, number.GetNumberString());
            return(editor.number);
        }
Exemplo n.º 2
0
 public string ChangeSystemBase(int _base)
 {
     number            = converter.ConvertBaseTo10(number.systemBase, editor.number);
     number.systemBase = _base;
     editor.number     = converter.Convert10ToBase(number.systemBase, number.GetNumberString());
     return(editor.number);
 }