예제 #1
0
		public static void Main()
		{
			Console.SetWindowSize(WindowWidth, Console.WindowHeight);
			Console.SetBufferSize(WindowWidth, Console.BufferHeight);
			_evaluator = new Evaluator();

			while (true)
			{
				Console.Write("> ");
				var input = Console.ReadLine() ?? string.Empty;

				if (SpecialActions.ContainsKey(input))
				{
					SpecialActions[input].Invoke();
					continue;
				}

				try
				{
					Console.WriteLine(CleanOutput(_evaluator.Evaluate(input)).PadLeft(WindowWidth, ' '));
				}
				catch (Exception ex)
				{
					Console.WriteLine(ex.Message.PadLeft(WindowWidth, ' '));
				}
			}
		}
예제 #2
0
		public MainWindow()
		{
			InitializeComponent();
			_evaluator = new Evaluator();
			FillInsertMenu();
			InputBox.Focus();
		}
예제 #3
0
		public void Initialize()
		{
			_evaluator = new Evaluator();
		}