public void ReadXml(System.Xml.XmlReader reader)
 {
     reader.MoveToContent();
     _DataAreaId = reader.ReadElementString();
     _FileName = reader.ReadElementString();
     _RecId = Int64.Parse(reader.ReadElementString());
 }
        public void ReadXml(System.Xml.XmlReader reader)
        {
            // Start to use the reader.
            reader.Read();
            // Read the first element ie root of this object
            reader.ReadStartElement("dictionary");

            // Read all elements
            while (reader.NodeType != XmlNodeType.EndElement) {
                // parsing the item
                reader.ReadStartElement("item");

                // PArsing the key and value
                string key = reader.ReadElementString("key");
                string value = reader.ReadElementString("value");

                // en reading the item.
                reader.ReadEndElement();
                reader.MoveToContent();

                // add the item
                this.Add(key, value);
            }

            // Extremely important to read the node to its end.
            // next call of the reader methods will crash if not called.
            reader.ReadEndElement();
        }
        /// <summary>
        /// </summary>
        /// <param name="reader"></param>
        public void ReadXml(System.Xml.XmlReader reader)
        {
            reader.MoveToContent();

            this.SalesId = reader.ReadElementString();
            this.Code = reader.ReadElementContentAsInt();
            this.Message = reader.ReadElementString();
            this.DataAreaId = reader.ReadElementString();
        }
 public void ReadXml(System.Xml.XmlReader reader)
 {
     reader.MoveToContent();
     _city = reader.ReadElementString();
     _country = reader.ReadElementString();
     _county = reader.ReadElementString();
     _postCode = reader.ReadElementString();
     _street = reader.ReadElementString();
 }
예제 #5
0
        public override void ReadXml(System.Xml.XmlReader reader)
        {
            int depth	= reader.Depth;

            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    if (reader.Name == Sitemap.NODE_TITLE)
                    {
                        this.Title	= reader.ReadElementString();
                    }
                    if (reader.Name == Sitemap.NODE_MODULE)
                    {
                        ModuleInfo moduleInfo	= new ModuleInfo(this);
                        moduleInfo.ID			= reader["id"];
                        moduleInfo.ViewControl	= reader["viewControl"];
                        moduleInfo.ReadXml( reader );

                        this.Add(moduleInfo);
                    }
                    if (reader.Name == Sitemap.NODE_INIT_PARAMS )
                        ReadInitParams( reader );
                }
                if(reader.Depth <= depth ) return;
            }
        }
예제 #6
0
    public void ReadXml(System.Xml.XmlReader reader)
    {
      reader.ReadStartElement("ConnectionData");
      reader.MoveToContent();

      while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
      {
        switch (reader.LocalName)
        {
          case "Authentication":
            Authentication newAuth;
            if (Enum.TryParse<Authentication>(reader.ReadElementString(reader.LocalName), out newAuth))
              this.Authentication = newAuth;
            break;
          case "Color":
            this.Color = FromHex(reader.ReadElementString(reader.LocalName));
            break;
          case "ConnectionName":
            this.ConnectionName = reader.ReadElementString(reader.LocalName);
            break;
          case "Database":
            this.Database = reader.ReadElementString(reader.LocalName);
            break;
          case "Password":
            var encrypted = reader.ReadElementString(reader.LocalName);
            string password;
            var success = TryDecryptWindows(encrypted, out password)
              || TryDecryptStatic(encrypted, out password);
            this.Password = password;
            break;
          case "Url":
            this.Url = reader.ReadElementString(reader.LocalName);
            break;
          case "UserName":
            this.UserName = reader.ReadElementString(reader.LocalName);
            break;
          case "Type":
            ConnectionType newType;
            if (Enum.TryParse<ConnectionType>(reader.ReadElementString(reader.LocalName), out newType))
              this.Type = newType;
            break;
          case "Confirm":
            Boolean newConfirm;
            if (Boolean.TryParse(reader.ReadElementString(reader.LocalName), out newConfirm))
              this.Confirm = newConfirm;
            break;
          default:
            reader.ReadOuterXml();
            reader.MoveToContent();
            break;
        }
      }

      if (this.Color == System.Drawing.Color.Empty)
      {
        var idx = (int)(((long)this.ConnectionName.GetHashCode() - int.MinValue) % _tabColors.Length);
        this.Color = _tabColors[idx];
      }
      reader.ReadEndElement();
    }
예제 #7
0
        public void ReadXml(System.Xml.XmlReader reader)
        {
            reader.Read();
            reader.Read();
            request_templates.Clear();
            while ( reader.Name.Equals( "Request" ) )
            {
                request_templates.Add( reader.ReadElementString() );
            }
            reader.Read();

            URL = reader.ReadElementString();
            SearchDateBeginInterval = Convert.ToInt32( reader.ReadElementString() );
            SearchDateEndInterval = Convert.ToInt32( reader.ReadElementString() );
            ShowResponse = Convert.ToBoolean( reader.ReadElementString() );
        }
예제 #8
0
 public void ReadXml(System.Xml.XmlReader reader)
 {
     string s = reader.ReadElementString();
     double d;
     if (double.TryParse(s, out d))
     {
         Value = d;
     }
 }
예제 #9
0
 public void ReadXml(System.Xml.XmlReader reader)
 {
     reader.Read();
     while (reader.NodeType != XmlNodeType.EndElement)
     {
         WindowPosition p = new WindowPosition();
         reader.ReadStartElement("window");
         string name = reader.ReadElementString("name");
         p.state =
             (FormWindowState)TypeDescriptor.GetConverter(typeof(FormWindowState))
             .ConvertFromString(reader.ReadElementString("state"));
         p.rect =
             (Rectangle)TypeDescriptor.GetConverter(typeof(Rectangle))
             .ConvertFromString(reader.ReadElementString("position"));
         reader.ReadEndElement();
         this.Add(name, p);
     }
     reader.ReadEndElement();
 }
예제 #10
0
 protected override void ReadProperties(System.Xml.XmlReader reader)
 {
   base.ReadProperties(reader);
   reader.MoveToContent();
   var isEmptyElement = reader.IsEmptyElement;
   reader.ReadStartElement("Paths");
   if (!isEmptyElement)
   {
     reader.MoveToContent();
     var paths = new List<string>();
     while (reader.LocalName == "Path")
     {
       paths.Add(reader.ReadElementString("Path"));
       reader.MoveToContent();
     }
     reader.ReadEndElement();
     _paths = paths;
   }
 }
예제 #11
0
 protected virtual void ReadProperties(System.Xml.XmlReader reader)
 {
     reader.MoveToContent();
       var isEmptyElement = reader.IsEmptyElement;
       reader.ReadStartElement("ProcessedPaths");
       if (!isEmptyElement)
       {
     reader.MoveToContent();
     while (reader.LocalName == "ProcessedPath")
     {
       _oldPaths.Add(reader.ReadElementString("ProcessedPath"));
       reader.MoveToContent();
     }
     reader.ReadEndElement();
       }
 }
예제 #12
0
        public override void ReadXml(System.Xml.XmlReader reader)
        {
            base.ReadXml(reader);
            SwitchType = (ToggleSwitchType)Enum.Parse(typeof(ToggleSwitchType), reader.ReadElementString("SwitchType"));
            Orientation = (ToggleSwitchOrientation)Enum.Parse(typeof(ToggleSwitchOrientation), reader.ReadElementString("Orientation"));
            if (reader.Name.Equals("ClickType"))
            {
                ClickType = (ClickType)Enum.Parse(typeof(ClickType), reader.ReadElementString("ClickType"));
            }
            else
            {
                ClickType = Controls.ClickType.Swipe;
            }

            reader.ReadStartElement("GuardUp");
            PositionOneGuardUpImage = reader.ReadElementString("PositionOneImage");
            PositionTwoGuardUpImage = reader.ReadElementString("PositionTwoImage");
            reader.ReadEndElement();

            reader.ReadStartElement("GuardDown");
            PositionOneGuardDownImage = reader.ReadElementString("PositionOneImage");
            PositionTwoGuardDownImage = reader.ReadElementString("PositionTwoImage");
            reader.ReadEndElement();

            DefaultPosition = (ToggleSwitchPosition)Enum.Parse(typeof(ToggleSwitchPosition), reader.ReadElementString("DefaultPosition"));
            DefaultGuardPosition = (GuardPosition)Enum.Parse(typeof(GuardPosition), reader.ReadElementString("DefaultGuardPosition"));

            BeginTriggerBypass(true);
            SwitchPosition = DefaultPosition;
            GuardPosition = DefaultGuardPosition;
            EndTriggerBypass(true);
        }
예제 #13
0
        /// <summary>
        /// Initialize the object using the specified XML reader
        /// </summary>
        /// <param name="reader">   XML reader</param>
        void IXmlSerializable.ReadXml(System.Xml.XmlReader reader)
        {
            bool    bIsEmpty;

            if (reader.MoveToContent() != XmlNodeType.Element || reader.LocalName != "Board") {
                throw new SerializationException("Unknown format");
            } else if (reader.GetAttribute("Version") != "1.00") {
                throw new SerializationException("Unknown version");
            } else {
                reader.ReadStartElement();
                reader.ReadStartElement("Pieces");
                for (int iIndex = 0; iIndex < m_pBoard.Length; iIndex++) {
                    m_pBoard[iIndex] = (PieceE)Enum.Parse(typeof(SerPieceE), reader.ReadElementString("Piece"));
                }
                reader.ReadEndElement();
                m_iBlackKingPos = Int32.Parse(reader.ReadElementString("BlackKingPosition"));
                m_iWhiteKingPos = Int32.Parse(reader.ReadElementString("WhiteKingPosition"));
                reader.ReadStartElement("PieceCount");
                for (int iIndex = 1; iIndex < m_piPiecesCount.Length - 1; iIndex++) {
                    m_piPiecesCount[iIndex] = Int32.Parse(reader.ReadElementString(((SerPieceE)iIndex).ToString()));
                }
                reader.ReadEndElement();
                m_iBlackKingMoveCount   = Int32.Parse(reader.ReadElementString("BlackKingMoveCount"));
                m_iWhiteKingMoveCount   = Int32.Parse(reader.ReadElementString("WhiteKingMoveCount"));
                m_iRBlackRookMoveCount  = Int32.Parse(reader.ReadElementString("RBlackRookMoveCount"));
                m_iLBlackRookMoveCount  = Int32.Parse(reader.ReadElementString("LBlackRookMoveCount"));
                m_iRWhiteRookMoveCount  = Int32.Parse(reader.ReadElementString("RWhiteRookMoveCount"));
                m_iLWhiteRookMoveCount  = Int32.Parse(reader.ReadElementString("LWhiteRookMoveCount"));
                m_bWhiteCastle          = Boolean.Parse(reader.ReadElementString("WhiteCastle"));
                m_bBlackCastle          = Boolean.Parse(reader.ReadElementString("BlackCastle"));
                m_iPossibleEnPassantAt  = Int32.Parse(reader.ReadElementString("EnPassant"));
                m_stackPossibleEnPassantAt.Clear();
                reader.MoveToContent();
                bIsEmpty = reader.IsEmptyElement;
                reader.ReadStartElement("EnPassantStack");
                if (!bIsEmpty) {
                    while (reader.IsStartElement()) {
                        m_stackPossibleEnPassantAt.Push(Int32.Parse(reader.ReadElementString("EP")));
                    }
                    reader.ReadEndElement();
                }
                ((IXmlSerializable)m_moveStack).ReadXml(reader);
                m_i64ZobristKey     = Int64.Parse(reader.ReadElementString("ZobristKey"));
                m_bDesignMode       = Boolean.Parse(reader.ReadElementString("DesignMode"));
                m_eNextMoveColor    = (PlayerColorE)Enum.Parse(typeof(PlayerColorE), reader.ReadElementString("NextMoveColor"));
                m_bStdInitialBoard  = Boolean.Parse(reader.ReadElementString("StandardBoard"));
                ((IXmlSerializable)m_moveHistory).ReadXml(reader);
                reader.MoveToContent();
                m_posInfo.m_iAttackedPieces     = Int32.Parse(reader.GetAttribute("AttackedPieces"));
                m_posInfo.m_iPiecesDefending    = Int32.Parse(reader.GetAttribute("PiecesDefending"));
                reader.ReadStartElement("PositionInfo");
                reader.ReadEndElement();
            }
        }
예제 #14
0
        internal void ReadXml(System.Xml.XmlReader reader)
        {
            reader.ReadStartElement();
            reader.MoveToContent();

            Check.Assert(reader.LocalName == "original_author", "Expected local name is 'original_author', not " + reader.LocalName);
            this.originalAuthor = GetHashData(reader, "original_author");
            reader.MoveToContent();

            string otherContributors = "other_contributors";
            if (reader.LocalName == otherContributors)
            {
                this.otherContributors = new OpenEhr.AssumedTypes.List<string>();
                do
                {
                    this.otherContributors.Add(reader.ReadElementString(otherContributors, RmXmlSerializer.OpenEhrNamespace));
                    reader.MoveToContent();
                } while (reader.LocalName == otherContributors);
            }

            string lifeCycle = "lifecycle_state";
            Check.Assert(reader.LocalName == lifeCycle, "Expected reader.LocalName is " + lifeCycle + ", not " + reader.LocalName);
            this.lifecycleState = reader.ReadElementString(lifeCycle, RmXmlSerializer.OpenEhrNamespace);
            reader.MoveToContent();

            string resourcePackageUriNodeName = "resource_package_uri";
            if (reader.LocalName == resourcePackageUriNodeName)
            {
                this.resourcePackageUri = reader.ReadElementString(resourcePackageUriNodeName, RmXmlSerializer.OpenEhrNamespace);
                reader.MoveToContent();
            }

            string otherDetailsNodeName = "other_details";
            if (reader.LocalName == otherDetailsNodeName)
            {
                this.otherDetails = GetHashData(reader, otherDetailsNodeName);
            }

            string detailsNodeName = "details";
            if (reader.LocalName == detailsNodeName)
            {
                System.Collections.Generic.Dictionary<string, ResourceDescriptionItem> detailsDic =
                    new System.Collections.Generic.Dictionary<string, ResourceDescriptionItem>();
                do
                {
                    ResourceDescriptionItem item = new ResourceDescriptionItem();
                    item.ReadXml(reader);

                    detailsDic.Add(item.Language.CodeString, item);

                } while (reader.LocalName == detailsNodeName);

                if (detailsDic.Count > 0)
                    this.details = new OpenEhr.AssumedTypes.Hash<ResourceDescriptionItem, string>(detailsDic);
            }

            string parentResourceNodeName = "parent_resource";
            if (reader.LocalName == parentResourceNodeName)
            {
                string resourceType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);

                this.parentResource = RmFactory.Instance.AuthoredResource(resourceType);
                DesignByContract.Check.Assert(parentResource != null, "must have an object with the type of "+resourceType);

                this.parentResource.ReadXml(reader);
            }

            if (!reader.IsStartElement())
            {
                reader.ReadEndElement();
                reader.MoveToContent();
            }
        }
예제 #15
0
        private AssumedTypes.Hash<string, string> GetHashData(System.Xml.XmlReader reader, string nodeName)
        {
            if (reader.LocalName == nodeName)
            {
                System.Collections.Generic.Dictionary<string, string> dictionary
                    = new System.Collections.Generic.Dictionary<string, string>();
                do
                {
                    string id = reader.GetAttribute("id");
                    string value = reader.ReadElementString(nodeName, RmXmlSerializer.OpenEhrNamespace);
                    reader.MoveToContent();

                    dictionary.Add(id, value);
                } while (reader.LocalName == nodeName);

                if (dictionary.Count > 0)
                   return new OpenEhr.AssumedTypes.Hash<string, string>(dictionary);
            }

            return null;
        }
예제 #16
0
 public override void ReadXml(System.Xml.XmlReader reader)
 {
     SerialNumber = reader.ReadElementString("SerialNumber");
 }
예제 #17
0
        internal void ReadXml(System.Xml.XmlReader reader)
        {
            reader.ReadStartElement();
            reader.MoveToContent();

            Check.Assert(reader.LocalName == "archetype_id", "Expected local name is 'archetype_id', not " + reader.LocalName);
            this.archetypeId = new OpenEhr.RM.Support.Identification.ArchetypeId();
            this.archetypeId.ReadXml(reader);

            if (reader.LocalName == "template_id")
            {
                this.templateId = new OpenEhr.RM.Support.Identification.TemplateId();
                this.templateId.ReadXml(reader);
            }

            Check.Assert(reader.LocalName == "rm_version", "Expected local name is 'rm_version', not " + reader.LocalName);
            this.rmVersion = reader.ReadElementString("rm_version", RmXmlSerializer.OpenEhrNamespace);

            reader.MoveToContent();

            if (!reader.IsStartElement())
            {
                reader.ReadEndElement();
                reader.MoveToContent();
            }
        }
예제 #18
0
    private static PackageMatch ParseMatch (System.Xml.XmlTextReader reader)
    {
        // Make sure we're in right position
        reader.ReadStartElement ("match");

        PackageMatch match = new PackageMatch ();

        if (reader.LocalName == "channel")
            match.ChannelId = reader.ReadElementString ();

        if (reader.LocalName == "dep") {
            PackageDep dep = new PackageDep (reader);
            match.Dep = dep;
            //dep.Unref ();

            // Move reader to start of next element
            while (reader.Read ())
                if (reader.NodeType == System.Xml.XmlNodeType.Element)
                    break;
        }

        if (reader.LocalName == "glob")
            match.Glob = reader.ReadElementString ();

        if (reader.LocalName == "importance") {
            int gteq = 0;
            string gteq_str = reader["gteq"];
            if (gteq_str != null)
                gteq = System.Xml.XmlConvert.ToInt32 (gteq_str);

            PackageImportance imp = RC.Global.PackageImportanceFromString (reader.ReadElementString ());
            match.SetImportance (imp, Convert.ToBoolean (gteq));
        }

        return match;
    }
예제 #19
0
        internal void ReadXml(System.Xml.XmlReader reader)
        {
            reader.ReadStartElement();
            reader.MoveToContent();

            Check.Assert(reader.LocalName == "language", "Expected local name is 'language', not " + reader.LocalName);
            this.language = new CodePhrase();
            this.language.ReadXml(reader);

            Check.Assert(reader.LocalName == "purpose", "Expected local name is 'purpose', not " + reader.LocalName);
            this.purpose = reader.ReadElementString("purpose", RmXmlSerializer.OpenEhrNamespace);
            reader.MoveToContent();

            while (reader.LocalName == "keywords")
            {
                if (this.keywords == null)
                    this.keywords = new OpenEhr.AssumedTypes.List<string>();
                this.keywords.Add(reader.ReadElementString("keywords", RmXmlSerializer.OpenEhrNamespace));
                reader.MoveToContent();
            }

            if (reader.LocalName == "use")
            {
                // TODO don't need this when the xml instance is fixed
                if (reader.IsEmptyElement)
                    reader.Skip();
                else
                    this.use = reader.ReadElementString("use", RmXmlSerializer.OpenEhrNamespace);
                reader.MoveToContent();
            }

            if (reader.LocalName == "misuse")
            {
                // TODO don't need this when the xml instance is fixed
                if (reader.IsEmptyElement)
                    reader.Skip();
                else
                    this.misuse = reader.ReadElementString("misuse", RmXmlSerializer.OpenEhrNamespace);
                reader.MoveToContent();
            }

            if (reader.LocalName == "copyright")
            {
                // TODO don't need this when the xml instance is fixed
                if (reader.IsEmptyElement)
                    reader.Skip();
                else
                    this.Copyright = reader.ReadElementString("copyright", RmXmlSerializer.OpenEhrNamespace);
                reader.MoveToContent();
            }

            if (reader.LocalName == "original_resource_uri")
            {
                System.Collections.Generic.Dictionary<string, string> originalResourceUriDic =
                    new System.Collections.Generic.Dictionary<string, string>();
                while (reader.LocalName == "original_resource_uri")
                {
                    string id = reader.GetAttribute("id");
                    if (string.IsNullOrEmpty(id))
                        throw new ValidationException("original_resource_uri must have id attribute and its value must not be null or empty.");
                    string value = reader.ReadElementString("original_resource_uri", RmXmlSerializer.OpenEhrNamespace);
                    reader.MoveToContent();
                    if (string.IsNullOrEmpty(value))
                        throw new ValidationException("original_resource_uri value must not be null or empty.");

                    originalResourceUriDic.Add(id, value);
                }
                if (originalResourceUriDic.Count <= 0)
                    throw new ValidationException("originalResourceUriDic must not be empty.");

                this.originalResourceUri = new OpenEhr.AssumedTypes.Hash<string, string>(originalResourceUriDic);
            }

            if (reader.LocalName == "other_details")
            {
                System.Collections.Generic.Dictionary<string, string> otherDetailsUriDic =
                    new System.Collections.Generic.Dictionary<string, string>();
                while (reader.LocalName == "other_details")
                {
                    string id = reader.GetAttribute("id");
                    if (string.IsNullOrEmpty(id))
                        throw new ValidationException("original_resource_uri must have id attribute and its value must not be null or empty.");
                    string value = reader.ReadElementString("original_resource_uri", RmXmlSerializer.OpenEhrNamespace);
                    reader.MoveToContent();
                    if (string.IsNullOrEmpty(value))
                        throw new ValidationException("original_resource_uri value must not be null or empty.");

                    otherDetailsUriDic.Add(id, value);
                }
                if (otherDetailsUriDic.Count <= 0)
                    throw new ValidationException("originalResourceUriDic must not be empty.");

                this.otherDetails = new OpenEhr.AssumedTypes.Hash<string, string>(otherDetailsUriDic);
            }

            if (!reader.IsStartElement())
            {
                reader.ReadEndElement();
                reader.MoveToContent();
            }
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="reader"></param>
 public void ReadXml(System.Xml.XmlReader reader)
 {
     reader.MoveToContent();
     _AllowOrder = int.Parse(reader.ReadElementString());
     _AllowReceiptOfGoods = int.Parse(reader.ReadElementString());
     _CellularPhone = reader.ReadElementString();
     _ContactPersonId = reader.ReadElementString();
     _DataAreaId = reader.ReadElementString();
     _Director = int.Parse(reader.ReadElementString());
     _Email = reader.ReadElementString();
     _EmailArriveOfGoods = int.Parse(reader.ReadElementString());
     _EmailOfDelivery = int.Parse(reader.ReadElementString());
     _EmailOfOrderConfirm = int.Parse(reader.ReadElementString());
     _Fax = reader.ReadElementString();
     _FinanceManager = int.Parse(reader.ReadElementString());
     _FirstName = reader.ReadElementString();
     _FunctionId = reader.ReadElementString();
     _Gender = int.Parse(reader.ReadElementString());
     _InvoiceInfo = int.Parse(reader.ReadElementString());
     _LastName = reader.ReadElementString();
     _LeftCompany = int.Parse(reader.ReadElementString());
     _Method = int.Parse(reader.ReadElementString());
     _Newsletter = int.Parse(reader.ReadElementString());
     _Phone = reader.ReadElementString();
     _PhoneLocal = reader.ReadElementString();
     _PriceListDownload = int.Parse(reader.ReadElementString());
     _RecId = long.Parse(reader.ReadElementString());
     _RefRecId = long.Parse(reader.ReadElementString());
     _SalesManager = int.Parse(reader.ReadElementString());
     _SimpleContact = int.Parse(reader.ReadElementString());
     _SimpleSales = int.Parse(reader.ReadElementString());
     _WebAdmin = int.Parse(reader.ReadElementString());
     _WebLoginName = reader.ReadElementString();
     _WebPassword = reader.ReadElementString();
 }
예제 #21
0
파일: DvUri.cs 프로젝트: nickvane/OpenEHR
        protected override void ReadXmlBase(System.Xml.XmlReader reader)
        {
            // Get value
            Check.Assert(reader.LocalName == "value", "reader.LocalName must be 'value' rathern than " + reader.LocalName);
            this.value = reader.ReadElementString("value",
                RmXmlSerializer.OpenEhrNamespace);

            reader.MoveToContent();
        }
예제 #22
0
 protected override void ReadXmlBase(System.Xml.XmlReader reader)
 {
     base.ReadXmlBase(reader);
     if (reader.LocalName == "path")
         this.path = reader.ReadElementString("path", RmXmlSerializer.OpenEhrNamespace);
 }
예제 #23
0
        public void ReadXml(System.Xml.XmlReader reader)
        {
            if (!reader.IsEmptyElement)
            {
                reader.ReadStartElement("DigitalInputs");
                while (reader.NodeType != XmlNodeType.EndElement)
                {
                    byte number = byte.Parse(reader.GetAttribute("Number"));
                    EosDigitalInput input = new EosDigitalInput(this, number);
                    input.Name = reader.ReadElementString("DigitalInput");
                    _digitalInputs.Add(input);
                    _inputs.Add(input);
                }
                reader.ReadEndElement();
            }
            else
            {
                reader.Read();
            }
            DigitalInputCount = (byte)DigitalInputs.Count;

            if (!reader.IsEmptyElement)
            {
                reader.ReadStartElement("AnalogInputs");
                while (reader.NodeType != XmlNodeType.EndElement)
                {
                    byte number = byte.Parse(reader.GetAttribute("Number"));
                    EosAnalogInput input = new EosAnalogInput(this, number);
                    input.Name = reader.ReadElementString("AnalogInput");
                    _analogInputs.Add(input);
                    _inputs.Add(input);
                }
                reader.ReadEndElement();
            }
            else
            {
                reader.Read();
            }
            AnalogInputCount = (byte)AnalogInputs.Count;

            if (!reader.IsEmptyElement)
            {
                reader.ReadStartElement("LEDOutputs");
                while (reader.NodeType != XmlNodeType.EndElement)
                {
                    byte number = byte.Parse(reader.GetAttribute("Number"));
                    EosLedOutput output = new EosLedOutput(this, number);
                    output.Name = reader.ReadElementString("LEDOutput");
                    _ledOutputs.Add(output);
                    _outputs.Add(output);
                }
                reader.ReadEndElement();
            }
            else
            {
                reader.Read();
            }
            LedOutputCount = (byte)LedOutputs.Count;

            if (!reader.IsEmptyElement)
            {
                reader.ReadStartElement("TextOutputs");
                while (reader.NodeType != XmlNodeType.EndElement)
                {
                    byte number = byte.Parse(reader.GetAttribute("Number"));
                    EosTextOutput output = new EosTextOutput(this, number);
                    output.Name = reader.ReadElementString("TextOutput");
                    _textOutputs.Add(output);
                    _outputs.Add(output);
                }
                reader.ReadEndElement();
            }
            else
            {
                reader.Read();
            }
            TextOutputCount = (byte)_textOutputs.Count;

            if (!reader.IsEmptyElement)
            {
                reader.ReadStartElement("ServoOutputs");
                while (reader.NodeType != XmlNodeType.EndElement)
                {
                    byte number = byte.Parse(reader.GetAttribute("Number"));
                    EosServo output = new EosServo(this, number);
                    output.Name = reader.GetAttribute("Name");
                    // TODO: Deprectated fix for bad element name... remove after 1.6
                    if (reader.Name.Equals("ServerOutput"))
                    {
                        reader.ReadStartElement("ServerOutput");
                    }
                    else
                    {
                        reader.ReadStartElement("ServoOutput");
                    }                    
                    output.Calibration.Read(reader);
                    reader.ReadEndElement();
                    _servoOutputs.Add(output);
                    _outputs.Add(output);
                }
                reader.ReadEndElement();
            }
            else
            {
                reader.Read();
            }
            ServoOutputCount = (byte)ServoOutputs.Count;

            if (!reader.IsEmptyElement)
            {
                reader.ReadStartElement("StepperOutputs");
                while (reader.NodeType != XmlNodeType.EndElement)
                {
                    byte number = byte.Parse(reader.GetAttribute("Number"));
                    EosStepper output = new EosStepper(this, number);
                    output.Name = reader.GetAttribute("Name");
                    reader.ReadStartElement("StepperOutput");
                    output.Calibration.Read(reader);
                    reader.ReadEndElement();
                    _stepperOutputs.Add(output);
                    _outputs.Add(output);
                }
                reader.ReadEndElement();
            }
            else
            {
                reader.Read();
            }
            StepperOutputCount = (byte)StepperOutputs.Count;

            if (reader.Name.Equals("CoilOutputs"))
            {
                if (!reader.IsEmptyElement)
                {
                    reader.ReadStartElement("CoilOutputs");
                    while (reader.NodeType != XmlNodeType.EndElement)
                    {
                        byte number = byte.Parse(reader.GetAttribute("Number"));
                        EosCoilOutput output = new EosCoilOutput(this, number);
                        output.Name = reader.GetAttribute("Name");
                        reader.ReadStartElement("CoilOutput");
                        output.Calibration.Read(reader);
                        reader.ReadEndElement();
                        _coilOutputs.Add(output);
                        _outputs.Add(output);
                    }
                    reader.ReadEndElement();
                }
                else
                {
                    reader.Read();
                }
            }
            CoilOutputCount = (byte)CoilOutputs.Count;
        }
        /// <summary>
        /// </summary>
        /// <param name="reader"></param>
        public void ReadXml(System.Xml.XmlReader reader)
        {
            reader.MoveToContent();

            _ContactPersonId = reader.ReadElementString();
            _CustomerId = reader.ReadElementString();
            _CustomerOrderNo = reader.ReadElementString();
            _CustomerRef = reader.ReadElementString();
            _DataAreaId = reader.ReadElementString();
            _DeliveryCity = reader.ReadElementString();
            _DeliveryDate = reader.ReadElementString();
            _DeliveryEmail = reader.ReadElementString();
            _DeliveryName = reader.ReadElementString();
            _DeliveryStreet = reader.ReadElementString();
            _DeliveryZip = reader.ReadElementString();
            _InventLocationId = reader.ReadElementString();
            _Payment = reader.ReadElementString();
            _RequiredDelivery = int.Parse(reader.ReadElementString()) > 0;
            _LineCount = int.Parse(reader.ReadElementString());
            _Lines.Clear();

            int depth = reader.Depth;
            bool read = reader.Read();
            while ((read) && (reader.Depth > depth))
            {
                reader.MoveToContent();

                if (reader.IsStartElement())
                {
                    SecondhandOrderLineCreate line = new SecondhandOrderLineCreate();
                    line.ReadXml(reader);
                    _Lines.Add(line);
                }

                read = reader.Read();
            }
        }
예제 #25
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;
            }
        }
예제 #26
0
 /// <summary>
 /// Interface implementation, which reads the content of the CDATA tag
 /// </summary>
 void IXmlSerializable.ReadXml(System.Xml.XmlReader reader)
 {
     this.text = reader.ReadElementString();
 }
예제 #27
0
 protected virtual void ReadXmlBase(System.Xml.XmlReader reader)
 {
     this.value = reader.ReadElementString("value", RmXmlSerializer.OpenEhrNamespace);
     reader.MoveToContent();
 }
예제 #28
0
        private static void ReadColorProperty(System.Xml.XmlReader reader, out KnownColor? knownColor, out Color color)
        {
            knownColor = null;
            color = default(Color);

            bool useSystemName = bool.Parse(reader.GetAttribute("UseSystemName"));

            string rawValue = reader.ReadElementString();

            if (useSystemName)
                knownColor = (KnownColor)Enum.Parse(typeof(KnownColor), rawValue);
            else
                color = Color.FromArgb(int.Parse(rawValue, System.Globalization.NumberStyles.HexNumber ));
        }
예제 #29
0
 public void ReadXml(System.Xml.XmlReader reader)
 {
     reader.ReadStartElement("ConnectionData");
       this.ConnectionName = reader.ReadElementString("ConnectionName");
       this.Database = reader.ReadElementString("Database");
       try
       {
     this.Password = RijndaelSimple.Decrypt(_encryptKey, reader.ReadElementString("Password"));
       }
       catch (System.Security.Cryptography.CryptographicException)
       {
     this.Password = string.Empty;
       }
       catch (FormatException)
       {
     this.Password = string.Empty;
       }
       this.Url = reader.ReadElementString("Url");
       this.UserName = reader.ReadElementString("UserName");
       if (reader.NodeType != System.Xml.XmlNodeType.EndElement)
       {
     this.IomVersion = reader.ReadElementString("IomVersion");
       }
       reader.ReadEndElement();
 }
예제 #30
0
 private static FontStyle ReadFontStyleProperty(System.Xml.XmlReader reader)
 {
     return (FontStyle)Enum.Parse(typeof(FontStyle), reader.ReadElementString());
 }