/// <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); }
/// <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); }
/// <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>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; }