static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var logger = new TextboxLogger(); var injector = new Injector(logger); var injectorForm = new InjectorForm(injector); Form injectorDebugForm = new InjectorDebugForm(injector, logger) { SwitchForm = injectorForm }; injectorForm.SwitchForm = injectorDebugForm; var startedForm = ConfigurationManager.AppSettings["StartedForm"] == "debug" ? injectorDebugForm : injectorForm; startedForm.Show(); Application.ApplicationExit += (object sender, EventArgs e) => { if (injector.Injected) { injector.Close(); } }; Application.Run(); }
public InjectorDebugForm(Injector injector, TextboxLogger logger) { InitializeComponent(); this.injector = injector; this.logger = logger; logger.Textbox = txtOutput; RefreshProcesses(); }