public async Task EncryptDecrypt() { if ((_key.Length > 0 && _key.Length % 32 == 0) && (_path != "")) { clock = new Timer(_timerInterval); clock.Elapsed += SyncProgress; clock.AutoReset = true; clock.Start(); _encDec = new EncDec(_key, _path); await Task.Run(() => _encDec.FileEncryptDecrypt()); clock.Stop(); clock.Dispose(); SyncProgress(this, null); } }