Represents a guid property.
Inheritance: Property
Exemplo n.º 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();

            p.Name = _name;
            AddProperty(p);
            return(_descriptor);
        }
Exemplo n.º 2
0
        /// <summary>Adds guid property to descriptor with previously chained name.</summary>
        /// <returns>descriptor with added property.</returns>
        public Descriptor AsGuid()
        {
            var p = new GuidProperty {
                Name = _name
            };

            AddProperty(p);
            return(_descriptor);
        }
Exemplo n.º 3
0
        public void Guid_Property_Save_And_Load()
        {
            GuidProperty p = new GuidProperty();
            p.Name = "MyProp";
            p.Categories = new Guid[] { Guid.NewGuid() };
            p.Discrete = false;
            p.Start = 5;

            Serialize(p);
            var property = Deserialize<GuidProperty>();
            Assert.Equal(p, property);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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;
        }
Exemplo n.º 6
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();
     p.Name = _name;
     AddProperty(p);
     return _descriptor;
 }