private void Validate() { if (string.IsNullOrEmpty(CleavageC) && string.IsNullOrEmpty(CleavageN)) { throw new InvalidDataException(Resources.Enzyme_Validate_Enzymes_must_have_at_least_one_cleavage_point); } var cleavageAll = String.Empty; if (string.IsNullOrEmpty(CleavageC)) { if (!string.IsNullOrEmpty(RestrictC)) { throw new InvalidDataException(Resources.Enzyme_Validate_Enzyme_must_have_C_terminal_cleavage_to_have_C_terminal_restrictions_); } CleavageC = RestrictC = null; _cleavageC = null; _restrictC = null; } else { AminoAcid.ValidateAAList(CleavageC); if (!string.IsNullOrEmpty(RestrictC)) { AminoAcid.ValidateAAList(RestrictC); } _cleavageC = CleavageC.ToCharArray(); _restrictC = RestrictC == null? null : RestrictC.ToCharArray(); cleavageAll = CleavageC; } if (string.IsNullOrEmpty(CleavageN)) { if (!string.IsNullOrEmpty(RestrictN)) { throw new InvalidDataException(Resources.Enzyme_Validate_Enzyme_must_have_N_terminal_cleavage_to_have_N_terminal_restrictions_); } CleavageN = RestrictN = null; _cleavageN = null; _restrictN = null; } else { AminoAcid.ValidateAAList(CleavageN); if (!string.IsNullOrEmpty(RestrictN)) { AminoAcid.ValidateAAList(RestrictN); } _cleavageN = CleavageN.ToCharArray(); _restrictN = RestrictN == null ? null : RestrictN.ToCharArray(); cleavageAll += CleavageN; } _cleavageAll = cleavageAll.ToCharArray(); }