Beispiel #1
0
        /// <summary>
        /// for 1.0
        /// </summary>
        private bool ReadTableInfoVersion1(XmlSchemaElement element, CremaDataTable dataTable)
        {
            var modifier = element.ReadAppInfoAsString(CremaSchema.TableInfo, CremaSchema.Modifier);

            if (modifier != null)
            {
                string modifiedDateTime = element.ReadAppInfoAsString(CremaSchema.TableInfo, CremaSchema.ModifiedDateTime);
                if (DateTime.TryParse(modifiedDateTime, out DateTime dateTime) == true)
                {
                    dataTable.InternalModificationInfo = new SignatureDate(modifier, dateTime);
                }
            }

            var creator = element.ReadAppInfoAsString(CremaSchema.TableInfo, CremaSchema.Creator);

            if (creator == null)
            {
                creator = element.ReadAppInfoAsString(CremaSchema.TableInfo, CremaSchemaObsolete.CreatorObsolete);
            }
            if (creator != null)
            {
                var createdDateTime = element.ReadAppInfoAsString(CremaSchema.TableInfo, CremaSchema.CreatedDateTime);
                if (DateTime.TryParse(createdDateTime, out DateTime dateTime) == true)
                {
                    dataTable.InternalCreationInfo = new SignatureDate(creator, dateTime);
                }
            }

            if (modifier != null || creator != null)
            {
                var properties = new PropertyCollection();
                this.ReadExtendedProperties(element, properties);
                if (properties.ContainsKey(CremaSchemaObsolete.DataLocation) == true)
                {
                    dataTable.InternalTags = new TagInfo(properties[CremaSchemaObsolete.DataLocation] as string);
                    properties.Remove(CremaSchemaObsolete.DataLocation);
                }
                foreach (DictionaryEntry item in properties)
                {
                    dataTable.ExtendedProperties.Add(item.Key, item.Value);
                }
            }

            return(modifier != null || creator != null);
        }