Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        public object this[long tag]
        {
            get
            {
                if (_Dataset != null)
                {
                    if (Utils.IsSequence(tag))
                    {
                        return(new Sequence(tag, this));
                    }

                    return(_Dataset.GetElementValue(tag, false));
                }
                return(null);
            }
            set
            {
                if (_Dataset != null)
                {
                    _Dataset.InsertElementAndSetValue(tag, value);
                }
            }
        }