using System; using System.Windows.Forms; using EfDbCommentGenerator.Core; namespace EfDbCommentGenerator { public partial class MainForm : Form { public MainForm() { InitializeComponent(); InitUi(); } private void InitUi() { Text = Application.ProductName; } private void MainForm_Shown(object sender, System.EventArgs e) { #if DEMO richTextBox1.Text = MetaMapper.Generate(Application.ExecutablePath); #else string asm; if (Program.CliArgs.Length == 0) { var dlg = new OpenFileDialog { Multiselect = false }; if (dlg.ShowDialog() == DialogResult.OK) { asm = dlg.FileName; } else { this.Close(); return; } } else { asm = Program.CliArgs[0]; } try { richTextBox1.Text = MetaMapper.Generate(asm); } catch (Exception ex) { richTextBox1.Text = ex.ToString(); } #endif } private void richTextBox1_MouseDoubleClick(object sender, MouseEventArgs e) { richTextBox1.SelectAll(); } } }