예제 #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);
            }
        }
예제 #2
0
        public PreproForm(ParsedPreprocessorOutput ppOutput)
        {
            PreproOutput = ppOutput;

            InitializeComponent();

            BuildModelFromOutput();

            hwPreproTree.Model             = _model;
            hwPreproTree.KeepNodesExpanded = true;
        }
예제 #3
0
파일: PreproForm.cs 프로젝트: ishani/VSOExp
        public PreproForm(ParsedPreprocessorOutput ppOutput)
        {
            PreproOutput = ppOutput;

              InitializeComponent();

              BuildModelFromOutput();

              hwPreproTree.Model = _model;
              hwPreproTree.KeepNodesExpanded = true;
        }
예제 #4
0
파일: LoaderForm.cs 프로젝트: ishani/VSOExp
    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();
      }
    }