Beispiel #1
0
 /// <summary>
 /// Clears all sequence items present in the attribute.
 /// </summary>
 /// <remarks>
 /// This method is only meaningfull if this instance has a VR SQ.
 /// </remarks>
 public override void ClearItems()
 {
     if (this.VR == VR.SQ)
     {
         DvtkDataSequence.Clear();
     }
     else
     {
         Thread.WriteWarningCurrentThread("Clearing the sequence items of an attribute with tag sequence " + TagSequence.ToString() + " and VR " + this.VR.ToString() + ". Doing nothing.");
     }
 }
Beispiel #2
0
        //
        // - Methods -
        //

        /// <summary>
        /// Adds a sequence item to the end of the item list.
        /// </summary>
        /// <remarks>
        /// This method is only meaningfull if this instance has a VR SQ.
        /// </remarks>
        /// <param name="item">The sequence item to add.</param>
        public override void AddItem(SequenceItem item)
        {
            if (this.VR == VR.SQ)
            {
                SequenceItem cloneSequenceItem = item.Clone();

                DvtkDataSequence.Add(cloneSequenceItem.DvtkDataSequenceItem);
            }
            else
            {
                Thread.WriteWarningCurrentThread("Adding a sequence item to an attribute with tag sequence " + TagSequence.ToString() + " and VR " + this.VR.ToString() + ". Doing nothing.");
            }
        }
Beispiel #3
0
 /// <summary>
 /// Removes a sequence item.
 /// </summary>
 /// <param name="oneBasedIndex">The one based index</param>
 public override void RemoveItemAt(int oneBasedIndex)
 {
     if (this.VR == VR.SQ)
     {
         if ((oneBasedIndex >= 1) && (oneBasedIndex <= ItemCount))
         {
             DvtkDataSequence.RemoveAt(oneBasedIndex - 1);
         }
         else
         {
             Thread.WriteWarningCurrentThread("Removing sequence item " + oneBasedIndex.ToString() + " from attribute with tag sequence " + TagSequence.ToString() + " containing " + ItemCount.ToString() + " items. Doing nothing.");
         }
     }
     else
     {
         Thread.WriteWarningCurrentThread("Removing a sequence item from attribute with tag sequence " + TagSequence.ToString() + " and VR " + this.VR.ToString() + ". Doing nothing.");
     }
 }
Beispiel #4
0
        /// <summary>
        /// Insert a Sequence Item at a specified position.
        /// </summary>
        /// <remarks>
        /// This method is only meaningfull if this instance has a VR SQ. The inserted Sequence
        /// Item will get item number oneBasedIndex.
        /// </remarks>
        /// <param name="oneBasedIndex">The one based index of the position to insert.</param>
        /// <param name="item">The Sequence item to insert.</param>
        public override void InsertItem(int oneBasedIndex, SequenceItem item)
        {
            if (this.VR == VR.SQ)
            {
                if ((oneBasedIndex >= 1) && (oneBasedIndex <= (ItemCount + 1)))
                {
                    SequenceItem cloneSequenceItem = item.Clone();

                    DvtkDataSequence.Insert(oneBasedIndex - 1, cloneSequenceItem.DvtkDataSequenceItem);
                }
                else
                {
                    Thread.WriteWarningCurrentThread("Inserting sequence item at one based position " + oneBasedIndex.ToString() + " fom attribute with tag sequence " + TagSequence.ToString() + " containing " + ItemCount.ToString() + " items. Doing nothing.");
                }
            }
            else
            {
                Thread.WriteWarningCurrentThread("Adding a sequence item to an attribute with tag sequence " + TagSequence.ToString() + " and VR " + this.VR.ToString() + ". Doing nothing.");
            }
        }
 /// <summary>
 /// Add an item to this sequence.
 /// </summary>
 /// <param name="sequenceItem"></param>
 public void AddItem(SequenceItem sequenceItem)
 {
     DvtkDataSequence.Add(sequenceItem.DvtkDataSequenceItem);
 }