private static bool IsMSParam(CvParam p) { if (string.IsNullOrWhiteSpace(p.CvAccession)) { return(false); } else { return(p.CvAccession.StartsWith("MS:", StringComparison.InvariantCultureIgnoreCase)); } }
public static bool TryGetParam <TPC>(this TPC pc, string accession, out CvParam param) where TPC : IParamContainer { if (pc == null) { throw new ArgumentNullException("pc"); } if (accession == null) { throw new ArgumentNullException("accession"); } return(pc.CvParams.TryGetItemByKey(accession, out param)); }
public static IHasUnit <TPC> SetCvParam <TPC>(this TPC pc, string accession) where TPC : IParamContainer { if (string.IsNullOrWhiteSpace(accession)) { throw new ArgumentOutOfRangeException("accession may not be null or empty."); } CvParam param; if (!pc.TryGetParam(accession, out param)) { param = new CvParam(accession); pc.CvParams.Add(param); } return(new HasUnit <TPC>(pc, param)); }
public IHasValue SetCvParam(string accession) { if (string.IsNullOrWhiteSpace(accession)) { throw new ArgumentNullException("accession"); } if (HasCvParam(accession)) { Param = ParamContainer.CvParams[accession]; } else { CvParam param = new CvParam(accession); ParamContainer.CvParams.Add(param); Param = param; } return(new HasValue(this)); }