/// <summary> /// Gets the sequence value. /// </summary> /// <param name="index">The item index withing the sequence.</param> /// <param name="tag">The tag to get.</param> /// <param name="list">if set to <c>true</c> [list].</param> /// <returns></returns> private object GetSequenceValue(int index, long tag, bool list) { object value = null; if (_Parent == null) { _Dataset.BeginReadSequence(_Tag).BeginReadItem(index); value = _Dataset.GetElementValue(tag, false); _Dataset.EndReadItem().EndReadSequence(); } else { List <Sequence> parents = new List <Sequence>(); try { AdvanceReadSequence(parents, index); value = _Dataset.GetElementValue(tag, false); } catch (Exception e) { Logger.Global.SystemException(string.Empty, e); } finally { RestoreReadSequence(parents); } } return(value); }