Esempio n. 1
0
        static void Main(string[] args)
        {
            Logger.OnLog       += Log;
            Logger.DebugLogging = true;

            Evaluator.Initialize();

            Console.ForegroundColor = ConsoleColor.White;
            Console.Write("Input> ");
            string input = Console.ReadLine();

            IResultValue res = Evaluator.Evaluate(input);

            Console.WriteLine("Evaluated: " + input);
            Console.WriteLine("Result: " + res.ToDisplayString());

            Console.ReadKey(true);
        }
Esempio n. 2
0
        private void GoBtn_Click(object sender, RoutedEventArgs e)
        {
            string input = EntryBox.Text;

            ListBoxItem inputLBI = new ListBoxItem();

            inputLBI.Content = input;
            inputLBI.HorizontalContentAlignment = HorizontalAlignment.Left;
            inputLBI.HorizontalAlignment        = HorizontalAlignment.Stretch;
            HistoryBox.Items.Add(inputLBI);

            IResultValue irv       = Evaluator.Evaluate(input);
            ListBoxItem  outputLBI = new ListBoxItem();

            outputLBI.Content = irv.ToDisplayString();
            outputLBI.HorizontalContentAlignment = HorizontalAlignment.Right;
            outputLBI.HorizontalAlignment        = HorizontalAlignment.Stretch;
            HistoryBox.Items.Add(outputLBI);

            EntryBox.Text = "";
            EntryBox.Focus();
        }