Ejemplo n.º 1
0
        private void GenerateClasses()
        {
            FoxClass entityClass = new FoxClass
            {
                Name    = "Entity",
                Super   = "",
                Version = "2"
            };

            _classes.Add(entityClass);

            FoxClass dataClass = new FoxClass
            {
                Name    = "Data",
                Super   = "Entity",
                Version = "2"
            };

            _classes.Add(dataClass);

            foreach (var entity in Entities)
            {
                FoxClass foxClass = new FoxClass
                {
                    Name    = entity.ClassName,
                    Version = entity.Version.ToString()
                };

                if (_classes.Contains(foxClass) == false)
                {
                    _classes.Add(foxClass);
                }
            }
        }
Ejemplo n.º 2
0
        public void ReadXml(XmlReader reader)
        {
            FormatVersion = reader.GetAttribute("formatVersion");
            FileVersion   = reader.GetAttribute("fileVersion");
            DateTime originalVersion;

            DateTime.TryParseExact(reader.GetAttribute("originalVersion"), "ddd MMM dd HH:mm:ss UTCzzz yyyy",
                                   CultureInfo.InvariantCulture,
                                   DateTimeStyles.None, out originalVersion);
            OriginalVersion = originalVersion;

            bool isEmptyElement = reader.IsEmptyElement;

            reader.ReadStartElement("fox");
            if (isEmptyElement)
            {
                return;
            }

            bool isClassesElementEmpty = reader.IsEmptyElement;

            reader.ReadStartElement("classes");
            if (isClassesElementEmpty == false)
            {
                while (reader.LocalName == "class")
                {
                    FoxClass foxClass = new FoxClass();
                    foxClass.ReadXml(reader);
                    _classes.Add(foxClass);
                }
                reader.ReadEndElement();
            }

            bool isEntitiesElementEmpty = reader.IsEmptyElement;

            reader.ReadStartElement("entities");
            if (isEntitiesElementEmpty == false)
            {
                while (reader.LocalName == "entity")
                {
                    FoxEntity foxEntity = new FoxEntity();
                    foxEntity.ReadXml(reader);
                    _entities.Add(foxEntity);
                }
                reader.ReadEndElement();
            }

            reader.ReadEndElement();
        }
Ejemplo n.º 3
0
 protected bool Equals(FoxClass other)
 {
     return string.Equals(Name, other.Name) && string.Equals(Super, other.Super);
 }
Ejemplo n.º 4
0
        private void GenerateClasses()
        {
            FoxClass entityClass = new FoxClass
            {
                Name = "Entity",
                Super = "",
                Version = "2"
            };
            _classes.Add(entityClass);

            FoxClass dataClass = new FoxClass
            {
                Name = "Data",
                Super = "Entity",
                Version = "2"
            };
            _classes.Add(dataClass);

            foreach (var entity in Entities)
            {
                FoxClass foxClass = new FoxClass
                {
                    Name = entity.ClassName,
                    Version = entity.Version.ToString()
                };

                if (_classes.Contains(foxClass) == false)
                    _classes.Add(foxClass);
            }
        }
Ejemplo n.º 5
0
        public void ReadXml(XmlReader reader)
        {
            FormatVersion = reader.GetAttribute("formatVersion");
            FileVersion = reader.GetAttribute("fileVersion");
            DateTime originalVersion;
            DateTime.TryParseExact(reader.GetAttribute("originalVersion"), "ddd MMM dd HH:mm:ss UTCzzz yyyy",
                CultureInfo.InvariantCulture,
                DateTimeStyles.None, out originalVersion);
            OriginalVersion = originalVersion;

            bool isEmptyElement = reader.IsEmptyElement;
            reader.ReadStartElement("fox");
            if (isEmptyElement) return;

            bool isClassesElementEmpty = reader.IsEmptyElement;
            reader.ReadStartElement("classes");
            if (isClassesElementEmpty == false)
            {
                while (reader.LocalName == "class")
                {
                    FoxClass foxClass = new FoxClass();
                    foxClass.ReadXml(reader);
                    _classes.Add(foxClass);
                }
                reader.ReadEndElement();
            }

            bool isEntitiesElementEmpty = reader.IsEmptyElement;
            reader.ReadStartElement("entities");
            if (isEntitiesElementEmpty == false)
            {
                while (reader.LocalName == "entity")
                {
                    FoxEntity foxEntity = new FoxEntity();
                    foxEntity.ReadXml(reader);
                    _entities.Add(foxEntity);
                }
                reader.ReadEndElement();
            }

            reader.ReadEndElement();
        }
Ejemplo n.º 6
0
 protected bool Equals(FoxClass other)
 {
     return(string.Equals(Name, other.Name) && string.Equals(Super, other.Super));
 }