@*   Xafari Framework version : 17.2.3011.1336   *@

@using System.Linq
@using Xafari.Web.Utils

@model Xafari.Mvc.Controls.ImageInfoControl

@if (!this.Model.ImageInfo.IsEmpty)
{
	var attrs = this.Model.HtmlAttrs == null ? new string[0]
		: this.Model.HtmlAttrs.GetType().GetProperties().Where(propertyInfo => propertyInfo.GetValue(this.Model.HtmlAttrs, null) != null)
			.Select(propertyInfo => string.Format(@"{0}=""{1}""", propertyInfo.Name, this.Html.Encode(propertyInfo.GetValue(this.Model.HtmlAttrs, null))));

	var @class = this.Model.HtmlAttrs == null ? null
		: this.Model.HtmlAttrs.GetType().GetProperties().FirstOrDefault(a => string.Compare(a.Name, "class", true) == 0);
    
	var className = ImageInfoHelper.GetCssClassName(this.Model.ImageInfo) + (@class == null ? "" : " " + @class);
	<div class="@className" @(new MvcHtmlString(string.Join(" ", attrs)))></div>
}
