public bool SaveTo(IErasureTarget target) { SecureMoveErasureTarget secureMove = target as SecureMoveErasureTarget; if (secureMove == null) { throw new ArgumentException("The provided erasure target type is not " + "supported by this configurer."); } secureMove.Path = fromTxt.Text; secureMove.Destination = toTxt.Text; return(true); }
public void LoadFrom(IErasureTarget target) { SecureMoveErasureTarget secureMove = target as SecureMoveErasureTarget; if (secureMove == null) { throw new ArgumentException("The provided erasure target type is not " + "supported by this configurer."); } fromTxt.Text = secureMove.Path; toTxt.Text = secureMove.Destination; moveFolderRadio.Checked = File.Exists(secureMove.Path) || Directory.Exists(secureMove.Path) && (File.GetAttributes(secureMove.Path) & FileAttributes.Directory) != 0; }