コード例 #1
0
ファイル: DvText.cs プロジェクト: nickvane/OpenEHR
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            //reader.ReadStartElement();
            //reader.MoveToContent();

            string openEhrNamespace = RmXmlSerializer.OpenEhrNamespace;

            Check.Assert(reader.LocalName == "value", "reader.LocalName must be 'value'");
            //this.value = reader.ReadElementString("value", openEhrNamespace);
            //this.valueSet = true;
            SetValue(reader.ReadElementString("value", openEhrNamespace));

            reader.MoveToContent();

            if (reader.LocalName == "hyperlink")
            {
                string linkType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);
                if (linkType != null)
                    this.hyperlink = new OpenEhr.RM.DataTypes.Uri.DvEhrUri();
                else
                    this.hyperlink = new OpenEhr.RM.DataTypes.Uri.DvUri();
                this.hyperlink.ReadXml(reader);
            }

            if (reader.LocalName == "formatting")
            {
                this.formatting = reader.ReadElementString("formatting", openEhrNamespace);
                //this.formattingSet = true;
            }

               // TODO: TermMapping
            if (reader.LocalName == "mappings")
            {
                this.mappings = new OpenEhr.AssumedTypes.List<TermMapping>(); //new List<TermMapping>();
                do
                {
                    TermMapping mapping = new TermMapping();
                    mapping.ReadXml(reader);
                    this.mappings.Add(mapping);

                } while (reader.LocalName == "mapping" && reader.NodeType == System.Xml.XmlNodeType.Element);
            }

            // language
            if (reader.LocalName == "language")
            {
                if (this.language == null)
                    this.language = new CodePhrase();
                this.language.ReadXml(reader);
                //this.languageSet = true;
            }

            // encoding
            if (reader.LocalName == "encoding")
            {
                if (this.encoding == null)
                    this.encoding = new CodePhrase();
                this.encoding.ReadXml(reader);
                //this.encodingSet = true;
            }
        }
コード例 #2
0
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            //reader.ReadStartElement();
            //reader.MoveToContent();

            string openEhrNamespace = RmXmlSerializer.OpenEhrNamespace;

            Check.Assert(reader.LocalName == "value", "reader.LocalName must be 'value'");
            //this.value = reader.ReadElementString("value", openEhrNamespace);
            //this.valueSet = true;
            SetValue(reader.ReadElementString("value", openEhrNamespace));

            reader.MoveToContent();

            if (reader.LocalName == "hyperlink")
            {
                string linkType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);
                if (linkType != null)
                {
                    this.hyperlink = new OpenEhr.RM.DataTypes.Uri.DvEhrUri();
                }
                else
                {
                    this.hyperlink = new OpenEhr.RM.DataTypes.Uri.DvUri();
                }
                this.hyperlink.ReadXml(reader);
            }

            if (reader.LocalName == "formatting")
            {
                this.formatting = reader.ReadElementString("formatting", openEhrNamespace);
                //this.formattingSet = true;
            }

            // TODO: TermMapping
            if (reader.LocalName == "mappings")
            {
                this.mappings = new OpenEhr.AssumedTypes.List <TermMapping>(); //new List<TermMapping>();
                do
                {
                    TermMapping mapping = new TermMapping();
                    mapping.ReadXml(reader);
                    this.mappings.Add(mapping);
                } while (reader.LocalName == "mapping" && reader.NodeType == System.Xml.XmlNodeType.Element);
            }

            // language
            if (reader.LocalName == "language")
            {
                if (this.language == null)
                {
                    this.language = new CodePhrase();
                }
                this.language.ReadXml(reader);
                //this.languageSet = true;
            }

            // encoding
            if (reader.LocalName == "encoding")
            {
                if (this.encoding == null)
                {
                    this.encoding = new CodePhrase();
                }
                this.encoding.ReadXml(reader);
                //this.encodingSet = true;
            }
        }