Beispiel #1
0
        /// <summary>
        /// Serialize DVT Detail Data to Xml.
        /// </summary>
        /// <param name="streamWriter">Stream writer to serialize to.</param>
        /// <param name="level">Recursion level. 0 = Top.</param>
        /// <returns>bool - success/failure</returns>
        public bool DvtDetailToXml(StreamWriter streamWriter, int level)
        {
            if (streamWriter == null)
            {
                return(true);
            }
            bool result = false;

            streamWriter.WriteLine("<Display>");
            if (Item is DicomMessage)
            {
                DicomMessage dicomMessage = (DicomMessage)Item;
                result = dicomMessage.DvtDetailToXml(streamWriter, level);
            }
            else if (Item is DataSet)
            {
                DataSet dataSet = (DataSet)Item;
                result = dataSet.DvtDetailToXml(streamWriter, level);
            }
            else if (Item is Attribute)
            {
                Attribute attribute = (Attribute)Item;
                result = attribute.DvtDetailToXml(streamWriter, level);
            }
            else if (Item is DicomFile)
            {
                DicomFile dicomFile = (DicomFile)Item;
                result = dicomFile.DvtDetailToXml(streamWriter, level);
            }
            else if (Item is SequenceItem)
            {
                SequenceItem sequenceItem = (SequenceItem)Item;
                result = sequenceItem.DvtDetailToXml(streamWriter, level);
            }
            streamWriter.WriteLine("</Display>");
            return(result);
        }