/// <summary> /// Create an object using the contents of the corresponding MzIdentML object /// </summary> /// <param name="it"></param> /// <param name="idata"></param> public IonTypeObj(IonTypeType it, IdentDataObj idata) : base(idata) { Charge = it.charge; FragmentArrays = new IdentDataList <FragmentArrayObj>(1); CVParams = new IdentDataList <CVParamObj>(1); UserParams = new IdentDataList <UserParamObj>(1); Index = new List <string>(); if (it.FragmentArray?.Count > 0) { FragmentArrays.AddRange(it.FragmentArray, f => new FragmentArrayObj(f, IdentData)); } if (it.cvParam?.Count > 0) { CVParams.AddRange(it.cvParam.Select(cvp => new CVParamObj(cvp, idata))); } if (it.userParam?.Count > 0) { UserParams.AddRange(it.userParam.Select(up => new UserParamObj(up, idata))); } }
/// <summary> /// Create an object using the contents of the corresponding MzIdentML object /// </summary> /// <param name="it"></param> /// <param name="idata"></param> public IonTypeObj(IonTypeType it, IdentDataObj idata) : base(idata) { Charge = it.charge; _fragmentArrays = null; _cvParam = null; Index = null; if (it.FragmentArray != null && it.FragmentArray.Count > 0) { FragmentArrays = new IdentDataList <FragmentArrayObj>(); foreach (var f in it.FragmentArray) { FragmentArrays.Add(new FragmentArrayObj(f, IdentData)); } } }