public TagBuilder_Progress(DynamicComponentBaseFor <TModel, TProperty> dynamicComponentBase) : base("progress", dynamicComponentBase) { /* Adicionar os atributos de acordo com o que for obtido no Metadata... */ //TagElement.AddInputTypeAttribute(fieldType); int?minimumLength = (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("Minimum", "Length") ?? (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("StringLength", "MinimumLength"); TagElement.AddInputAttributeIsNotNullAndExpressionIsTrue("minlength", minimumLength, minimumLength.HasValue && minimumLength.Value > 0); int?maximumLength = (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("Maximum", "Length") ?? (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("StringLength", "MaximumLength"); TagElement.AddInputAttributeIsNotNullAndExpressionIsTrue("maxlength", maximumLength, maximumLength.HasValue && maximumLength.Value > 0); /* Adicionar os atributos de acordo com o que for obtido no HtmlAttributes... */ TagElement.MergeInputAttributeHtmlAttributes("class", this.ComponentBase.HtmlAttributes); //TagElement.DeleteValueInAttribute("class", "form-control"); TagElement.MergeInputAttributeHtmlAttributes("style", this.ComponentBase.HtmlAttributes); TagElement.AddInputAttributeHtmlAttributes("minlength", this.ComponentBase.HtmlAttributes); TagElement.AddInputAttributeHtmlAttributes("maxlength", this.ComponentBase.HtmlAttributes); /* Injetando o Valor no Input... */ double?maxValue = this.ComponentBase.MetadataAttributes.GetValue <double>("ProgressAttribute", "MaxValue"); TagElement.AddInputAttributeIsNotNullAndExpressionIsTrue("max", maxValue, maxValue != null); this.Value = this.ComponentBase.FieldValue; TagElement.AddInputAttributeIsNotNullAndExpressionIsTrue("value", this.Value, this.Value != null); }
public TagBuilder_Password(DynamicComponentBaseFor <TModel, TProperty> dynamicComponentBase) : base("input", dynamicComponentBase) { /* Adicionar os atributos de acordo com o que for obtido no Metadata... */ //TagElement.AddInputTypeAttribute(fieldType); TagElement.AddInputAttributeStaticValue("type", "password"); int?minimumLength = (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("Minimum", "Length") ?? (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("StringLength", "MinimumLength"); TagElement.AddInputAttributeIsNotNullAndExpressionIsTrue("minlength", minimumLength, minimumLength.HasValue && minimumLength.Value > 0); int?maximumLength = (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("Maximum", "Length") ?? (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("StringLength", "MaximumLength"); TagElement.AddInputAttributeIsNotNullAndExpressionIsTrue("maxlength", maximumLength, maximumLength.HasValue && maximumLength.Value > 0); TagElement.MergeInputAttributeIsNotNull("class", this.ComponentBase.MetadataAttributes.GetValue <object>("OnlyNumber", "ClassDecorator")); TagElement.MergeInputAttributeIsNotNull("class", this.ComponentBase.MetadataAttributes.GetValue <object>("Currency", "ClassDecorator")); TagElement.MergeInputAttributeIsNotNull("pattern", this.ComponentBase.MetadataAttributes.GetValue <object>("Currency", "Pattern")); TagElement.MergeInputAttributeIsNotNull("class", this.ComponentBase.MetadataAttributes.GetValue <object>("NoEspecialChars", "ClassDecorator")); /* Adicionar os atributos de acordo com o que for obtido no HtmlAttributes... */ TagElement.MergeInputAttributeHtmlAttributes("class", this.ComponentBase.HtmlAttributes); TagElement.MergeInputAttributeHtmlAttributes("style", this.ComponentBase.HtmlAttributes); TagElement.AddInputAttributeHtmlAttributes("minlength", this.ComponentBase.HtmlAttributes); TagElement.AddInputAttributeHtmlAttributes("maxlength", this.ComponentBase.HtmlAttributes); /* Injetando o Valor no Input... */ this.Value = this.ComponentBase.FieldValue; TagElement.AddInputAttributeIsNotNull("value", this.Value); }
public CustomTagBuilder(string tagElementType, DynamicComponentBaseFor <TModel, TProperty> componentBase) { this.TagElementType = tagElementType; this.ComponentBase = componentBase; InicializeTagElement(); }
public TagBuilder_Select(DynamicComponentBaseFor <TModel, TProperty> dynamicComponentBase) : base("select", dynamicComponentBase) { /* Adicionar os atributos de acordo com o que for obtido no HtmlAttributes... */ TagElement.MergeInputAttributeHtmlAttributes("class", this.ComponentBase.HtmlAttributes); TagElement.MergeInputAttributeHtmlAttributes("style", this.ComponentBase.HtmlAttributes); /* Injetando o Valor no Input... */ this.Value = this.ComponentBase.FieldValue; TagElement.AddInputAttributeIsNotNull("value", this.Value); }
public TagBuilder_Range(DynamicComponentBaseFor <TModel, TProperty> dynamicComponentBase) : base("input", dynamicComponentBase) { /* Adicionar os atributos de acordo com o que for obtido no Metadata... */ //TagElement.AddInputTypeAttribute(fieldType); TagElement.AddInputAttributeIsNotNull("type", "range"); TagElement.AddInputAttributeIsNotNull("min", this.ComponentBase.MetadataAttributes.GetValue <double>("Progress", "MinValue")); TagElement.AddInputAttributeIsNotNull("max", this.ComponentBase.MetadataAttributes.GetValue <double>("Progress", "MaxValue")); TagElement.AddInputAttributeIsNotNull("step", this.ComponentBase.MetadataAttributes.GetValue <double>("Progress", "Step")); /* Adicionar os atributos de acordo com o que for obtido no HtmlAttributes... */ TagElement.MergeInputAttributeHtmlAttributes("class", this.ComponentBase.HtmlAttributes); TagElement.MergeInputAttributeHtmlAttributes("style", this.ComponentBase.HtmlAttributes); /* Injetando o Valor no Input... */ this.Value = this.ComponentBase.FieldValue; TagElement.AddInputAttributeIsNotNull("value", this.Value); }