Exemplo n.º 1
0
        private async void hwLoadPrepro_Click(object sender, EventArgs e)
        {
            if (hwOpenFilePrepro.ShowDialog(this) == DialogResult.OK)
            {
                hwProgress.Visible = true;

                var output = await Task.Factory.StartNew(() =>
                {
                    var ppOutput = new ParsedPreprocessorOutput();
                    bool success = ppOutput.ParseFromFile(hwOpenFilePrepro.FileName);
                    return(success ? ppOutput : null);
                });

                if (output == null)
                {
                    MessageBox.Show(this, "Failed to parse: " + hwOpenFilePrepro.FileName, "Parse Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                hwProgress.Visible = false;

                var ppForm = new PreproForm(output);
                ppForm.Text = hwOpenFilePrepro.FileName;
                ppForm.Show(this);
            }
        }
Exemplo n.º 2
0
        public PreproForm(ParsedPreprocessorOutput ppOutput)
        {
            PreproOutput = ppOutput;

            InitializeComponent();

            BuildModelFromOutput();

            hwPreproTree.Model             = _model;
            hwPreproTree.KeepNodesExpanded = true;
        }
Exemplo n.º 3
0
        public PreproForm(ParsedPreprocessorOutput ppOutput)
        {
            PreproOutput = ppOutput;

              InitializeComponent();

              BuildModelFromOutput();

              hwPreproTree.Model = _model;
              hwPreproTree.KeepNodesExpanded = true;
        }
Exemplo n.º 4
0
    private async void hwLoadPrepro_Click(object sender, EventArgs e)
    {
      if ( hwOpenFilePrepro.ShowDialog() == DialogResult.OK )
      {
        hwProgress.Visible = true;

        ParsedPreprocessorOutput ppOutput = new ParsedPreprocessorOutput();
        await Task.Run(() => ppOutput.ParseFromFile(hwOpenFilePrepro.FileName));

        hwProgress.Visible = false;

        PreproForm ppForm = new PreproForm(ppOutput);
        ppForm.Text = hwOpenFilePrepro.FileName;
        ppForm.Show();
      }
    }