/// <summary> /// Checks is export type correct. /// </summary> /// <returns>TRUE if type correct.</returns> private bool _IsValidType() { var cbType = (ComboBox)ctrlGeneral.FindName("comboboxType"); string value = (null == cbType.SelectedItem) ? null : cbType.SelectedItem.ToString(); var validator = new ExportProfileNotEmptyValidationRule(); ValidationResult res = validator.Validate(value, CultureInfo.CurrentCulture); return _ValidationResultRoutine(res.IsValid, ValidationRes_Type); }
/// <summary> /// Checks is export file name correct. /// </summary> /// <returns>TRUE if file name correct.</returns> private bool _IsValidFile() { var tbFile = (TextBox)ctrlGeneral.FindName("textboxFile"); string fileName = (FileHelpers.ValidateFilepath(tbFile.Text)) ? tbFile.Text : null; bool isValid = false; if (!string.IsNullOrEmpty(fileName)) { var validator = new ExportProfileNotEmptyValidationRule(); ValidationResult res = validator.Validate(fileName, CultureInfo.CurrentCulture); isValid = res.IsValid; } return _ValidationResultRoutine(isValid, ValidationRes_File); }