public UploadResultHandler(IInvisibleForm form, Config config) { if (form == null) throw new ArgumentNullException(nameof(form)); if (config == null) throw new ArgumentNullException(nameof(config)); _form = form; _config = config; }
public UploaderForm() { ConfigureInvisibleForm(); ConfigureTrayMenu(); _config = Config.Load("config.json"); _uploadQueue = new UploadQueue(new ServerApi(_config), new UploadResultHandler(this, _config)); _handler = new KeyHandler(this, _uploadQueue.QueueImage); _hook = new KeyboardHook(); _handler.RegisterKeys(_hook); _hook.KeyPressed += _handler.Handle; FormClosed += UploaderForm_FormClosed; }