SemeionModulesDesigner.XmlSchemaParser.XmlParser.ResolveAttributes C# (CSharp) Method

ResolveAttributes() private method

Fill given XContainer attributes with data form Xml file.
private ResolveAttributes ( SemeionModulesDesigner.XmlSchemaParser.XsdModel.XContainer container, XmlElement xmlElement ) : void
container SemeionModulesDesigner.XmlSchemaParser.XsdModel.XContainer XContainer to be filled up.
xmlElement System.Xml.XmlElement XmlElement with data.
return void
        private void ResolveAttributes(XContainer container, XmlElement xmlElement)
        {
            if (xmlElement != null)
            {
                foreach (IXAttribute attribute in container.Attributes)
                {
                    string value = xmlElement.GetAttribute(attribute.Name);

                    if (!string.IsNullOrEmpty(value))
                    {
                        if (attribute is XAttribute<string>)
                        {
                            ((XAttribute<string>)attribute).Value = value;
                        }
                        else if (attribute is XAttribute<int>)
                        {
                            ((XAttribute<int>)attribute).Value = int.Parse(value);
                        }
                        else if (attribute is XAttribute<bool>)
                        {
                            ((XAttribute<bool>)attribute).Value = bool.Parse(value);
                        }
                        else if (attribute is XAttribute<DateTime>)
                        {
                            ((XAttribute<DateTime>)attribute).Value = DateTime.Parse(value);
                        }
                        else if (attribute is XEnumerationAttribute<string>)
                        {
                            ((XEnumerationAttribute<string>)attribute).Value = value;
                        }
                    }
                }
            }
        }