Пример #1
0
        /// <summary>Adds guid property to descriptor with previously chained name.</summary>
        /// <returns>descriptor with added property.</returns>
        public Descriptor AsGuid()
        {
            GuidProperty p = new GuidProperty
            {
                Name = _name
            };

            AddProperty(p);
            return(_descriptor);
        }
Пример #2
0
        /// <summary>Generates a property.</summary>
        /// <exception cref="InvalidOperationException">Thrown when the requested operation is invalid.</exception>
        /// <param name="property">The property.</param>
        /// <returns>The property.</returns>
        public override Property GenerateProperty(PropertyInfo property)
        {
            if (property.PropertyType != typeof(Guid))
            {
                throw new InvalidOperationException("Must use a guid property.");
            }

            var gp = new GuidProperty
            {
                Name     = property.Name,
                Discrete = true
            };

            return(gp);
        }