public void CopyFile(string filename) { if (SourcePath.Equals("") || DestPath.Equals("")) { return; } if (SourcePath.Equals(DestPath)) { var result = MessageBox.Show("Такой файл уже существует, вы " + "хотите его заменить?", "Замена файла", MessageBoxButton.YesNo, MessageBoxImage.Warning); if (result != MessageBoxResult.OK) { return; } } File.Copy(SourcePath + filename, DestPath + filename, true); if (UpdateListListener != null) { UpdateListListener.UpdateList(SourcePath, filename); } }