コード例 #1
0
        public void Run()
        {
            ResultsWindow.Open();

            var lineNumber = 1;
            var builder    = new StringBuilder();

            foreach (var line in _editor.Text.Split(new [] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
            {
                if (line.Trim().Length == 0)
                {
                    continue;
                }

                try
                {
                    builder.AppendLine(_parser.ProgrammaticallyParse(line).ToString(CultureInfo.InvariantCulture));
                }
                catch (Exception e)
                {
                    builder.AppendLine("ERROR (Line " + lineNumber + ") : " + e.Message);
                }

                lineNumber++;
            }

            ResultsWindow.Instance.Results.Text = builder.ToString();
        }
コード例 #2
0
        public static void Open()
        {
            if (Instance != null)
            {
                return;
            }

            Instance = new ResultsWindow();
            Instance.Show();
        }
コード例 #3
0
 private void ResultsWindow_OnClick(object sender, RoutedEventArgs e)
 {
     ResultsWindow.Open();
 }
コード例 #4
0
 private void ResultsWindow_OnClosed(object sender, EventArgs e)
 {
     Instance = null;
 }
コード例 #5
0
 private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
 {
     ResultsWindow.Open();
 }