/// <summary> /// This method is called when first instance of the application is started. /// </summary> protected override async void OnCreateMainForm() { var monitor = TorrentMonitor.FromDisk(ConfigFilePath, StateFilePath).WaitAndUnwrapException(); MainForm = new MainForm(monitor); await AddTorrentAsync(CommandLineArgs).ConfigureAwait(false); }
public MainForm(TorrentMonitor monitor) { this.monitor = monitor ?? throw new ArgumentNullException(nameof(monitor)); InitializeComponent(); }