/// <summary> /// Initializes a new instance of the <see cref="UmbracoPropertyAttribute" /> class. /// </summary> /// <param name="propertyAlias">The property alias.</param> /// <param name="propertyType">Type of the property.</param> /// <param name="contentTab">The content tab.</param> /// <param name="codeFirst">if set to <c>true</c> [code first].</param> public UmbracoPropertyAttribute(string propertyAlias, UmbracoPropertyType propertyType, string contentTab = "General Properties", bool codeFirst = true) { PropertyAlias = propertyAlias; ContentTab = contentTab; CodeFirst = codeFirst; PropertyType = propertyType; }
/// <summary> /// Initializes a new instance of the <see cref="UmbracoPropertyAttribute" /> class. /// </summary> /// <param name="propertyAlias">The property alias.</param> /// <param name="propertyType">Type of the property.</param> /// <param name="contentTab">The content tab.</param> /// <param name="codeFirst">if set to <c>true</c> [code first].</param> public UmbracoPropertyAttribute(string propertyAlias, UmbracoPropertyType propertyType, string contentTab = "General Properties", bool codeFirst = true) { PropertyAlias = propertyAlias; ContentTab = contentTab; CodeFirst = codeFirst; PropertyType = propertyType; }
public void Configure_SettingDataType_DataTypeIsSetOnConfiguration( [Values(UmbracoPropertyType.TextString)] UmbracoPropertyType value, [Values(UmbracoPropertyType.TextString)] UmbracoPropertyType expected) { //Assign var attr = new UmbracoPropertyAttribute(string.Empty); var propertyInfo = typeof(StubClass).GetProperty("DummyProperty"); attr.PropertyType = value; //Act var result = attr.Configure(propertyInfo) as UmbracoPropertyConfiguration; //Assert result.Should().NotBeNull(); result.PropertyType.ShouldBeEquivalentTo(expected); }
/// <summary> /// The umbraco property type for a code first property /// </summary> /// <param name="propertyType">Type of the property.</param> /// <returns></returns> public UmbracoProperty <T> PropertyType(UmbracoPropertyType propertyType) { Configuration.PropertyType = propertyType; return(this); }
/// <summary> /// Only umbraco data type is required. /// If you don't specify other named parameters, default values will be used. /// </summary> /// <param name="type">Umbraco Data Type related with this property</param> public DocumentTypePropertyAttribute(UmbracoPropertyType type) : this() { this.Type = type; }
/// <summary> /// Only umbraco data type is required. /// If you don't specify other named parameters, default values will be used. /// </summary> /// <param name="type">Umbraco Data Type related with this property</param> public DocumentTypePropertyAttribute(UmbracoPropertyType type) : this() { this.Type = type; }
/// <summary> /// Declares a member type property. Use this property in MemberType definition class /// </summary> /// <param name="type">Property data type</param> public MemberTypePropertyAttribute(UmbracoPropertyType type) : base(type) { }
/// <summary> /// Declares a member type property. Use this property in MemberType definition class /// </summary> /// <param name="type">Property data type</param> public MemberTypePropertyAttribute(UmbracoPropertyType type) : base(type) { }