/// <summary> /// Returns the dataset with the specified <paramref name="dataSetIndex" /> from the <see cref="MeshValueList" /> with the specified <paramref name="dataType" />. /// If no <paramref name="dataSetIndex" /> is specified, the method will return the first dataset or <code>null</code>, in case the list is empty. /// </summary> /// <param name="dataType">Type of the data.</param> /// <param name="dataSetIndex">Index of the data set.</param> /// <returns></returns> public MeshValueList GetMeshValueList(string dataType, int dataSetIndex = -1) { var meshValueList = MeshValues.Where(list => list.Entry.DataType == dataType).ToArray(); if (meshValueList.Length == 0) { return(null); } if (dataSetIndex < 0) { return(meshValueList[0]); } if (meshValueList.Length > 0 && dataSetIndex >= 0 && dataSetIndex < meshValueList.Length) { return(meshValueList[dataSetIndex]); } return(null); }
/// <summary> /// Returns all <see cref="MeshValueList" /> with the specified <paramref name="dataType" />. /// </summary> /// <param name="dataType">Type of the data.</param> /// <returns></returns> public MeshValueList[] GetMeshValueLists(string dataType) { return(MeshValues.Where(list => string.Equals(list.Entry.DataType, dataType, StringComparison.OrdinalIgnoreCase)).ToArray()); }