Represents a guid property.
Inheritance: Property
Exemple #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);
        }
Exemple #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);
        }
        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);
        }
Exemple #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);
        }
Exemple #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;
        }
 /// <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;
 }