Esempio n. 1
0
        public static XmlItemBuilder Create(XmlItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            return(new XmlItemBuilder(item.ValueType)
            {
                Name = item.Name,
                TypeHandling = item.TypeHandling,
                KnownTypes = item.KnownTypes != null?XmlKnownTypeBuilderCollection.Create(item.KnownTypes) : null
            });
        }
        public static XmlPropertyBuilder Create(XmlProperty property)
        {
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            return(new XmlPropertyBuilder(property.PropertyInfo)
            {
                Name = property.Name,
                MappingType = property.MappingType,
                NullValueHandling = property.NullValueHandling,
                TypeHandling = property.TypeHandling,
                DefaultValueHandling = property.DefaultValueHandling,
                DefaultValue = property.DefaultValue,
                IsRequired = property.IsRequired,
                IsCollection = property.IsCollection,
                Order = property.Order,
                Item = property.Item != null?XmlItemBuilder.Create(property.Item) : null,
                           KnownTypes = property.KnownTypes != null?XmlKnownTypeBuilderCollection.Create(property.KnownTypes) : null
            });
        }