protected override void OnLoad(EventArgs e) { const string md5File = "Services\\md5.map"; SetFormVisibility(false); LoadServices(); LoadSettings(); _fileMd5Map = new FileMd5Service(md5File); Runner = new FileChecker(_listServices, _fileMd5Map); Runner.StartUploading += (sender, args) => ShowNotification(args.Type.ToString(), args.FileName, args.Provider?.Icon); Runner.FinishedUploading += (sender, args) => ShowNotification($"Finished {args.Type}ing", args.FileName, args.Provider?.Icon); Runner.ErrorUploading += (sender, args) => ShowNotification($"Error {args.Type}ing", args.FileName + Environment.NewLine + args.Exception.Message, args?.Provider?.Icon); Runner.Run(CancellationToken.None); base.OnLoad(e); }
public object Check(string[] args) { return(_fileChecker.Run(args)); }