public override void Fill(ShuttlePropertyBag propertyBag, FillerParams fillerParams) { //Filling implementation code if (fillerParams.OverrideSettings != null && fillerParams.OverrideSettings.Count > 0) { propertyBag.TabIndex = Convert.ToInt16(fillerParams.OverrideSettings[ControlLibConstants.TAB_INDEX]); propertyBag.ActionUrl = fillerParams.OverrideSettings[ControlLibConstants.ACTION_URL]; propertyBag.ValueMember = fillerParams.OverrideSettings[ControlLibConstants.VALUE_MEMBER]; propertyBag.DisplayMember = fillerParams.OverrideSettings[ControlLibConstants.DISPLAY_MEMBER]; propertyBag.OnChangeFunction = fillerParams.OverrideSettings[ControlLibConstants.ON_CHANGE_FUNCTION]; propertyBag.ShuttleParam = fillerParams.InputParam; if (propertyBag.Style == null && (fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) || fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT))) { propertyBag.Style = new StylePropertyBag(); } if (propertyBag.Style != null) { propertyBag.Style.Width = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) ? fillerParams.OverrideSettings[ControlLibConstants.WIDTH] : string.Empty; propertyBag.Style.Height = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT) ? fillerParams.OverrideSettings[ControlLibConstants.HEIGHT] : string.Empty; } if (fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS] != string.Empty) { propertyBag.CssClass = fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS]; } } propertyBag.ReadOnly = fillerParams.IsReadOnly.HasValue ? fillerParams.IsReadOnly.Value : propertyBag.ReadOnly; propertyBag.Enabled = fillerParams.IsEnabled.HasValue ? fillerParams.IsEnabled.Value : propertyBag.Enabled; SetVisibility(propertyBag, fillerParams); }
public override void Fill(ShuttlePropertyBag propertyBag, FillerParams fillerParams) { if (fillerParams.SkipSecurityFill == false) { IModelPropertyConfiguration propertyConfig = ReadPropertyConfiguration(fillerParams.ModelName, fillerParams.PropertyName, fillerParams.ConfigKey); if (propertyConfig != null) { IAccessPolicy accessSecurity = GetAccess(propertyConfig.PropertyConfiguration.Security); if (accessSecurity != null) { propertyBag.Enabled = accessSecurity.Enabled; propertyBag.ReadOnly = accessSecurity.ReadOnly; propertyBag.Visibility = accessSecurity.Visibility; } } else { setDefalutSecurity(propertyBag); } } else { setDefalutSecurity(propertyBag); } }
public static MvcHtmlString BallyShuttleList <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, string actionUrl, string valueMember, string displayMember, IDictionary <string, object> shuttleParam = null, StylePropertyBag style = null, short tabIndex = 0, string onChangeFunction = "", string cssClass = "") { string propertyName = string.Empty; string modelName = string.Empty; object value = string.Empty; string errMsg = string.Empty; string controlHTMLString = string.Empty; Dictionary <string, string> overrideSettings; string configKey = string.Empty; ShuttleHTMLEmitter controlHTMLEmitter; ControlExtension.GetPropertyNameAndValue <TModel, TProperty>(htmlHelper, expression, out propertyName, out modelName, out value, out errMsg, out configKey); overrideSettings = GetBallyShuttleListOverrideSettings(actionUrl, valueMember, displayMember, style, tabIndex, onChangeFunction, value, cssClass); FillerParams fillerParams = new FillerParams(modelName, propertyName, overrideSettings, inputParam: shuttleParam, configKey: configKey); var fillers = ControlPropertyFillerFactory.Get(); var controlpropertyBag = new ShuttlePropertyBag(fillerParams); controlpropertyBag.Accept(fillers); controlpropertyBag.ErrorMessage = errMsg; controlpropertyBag.IsDirty = string.IsNullOrEmpty(errMsg) ? false : true; controlHTMLEmitter = new ShuttleHTMLEmitter(value != null ? value.ToString() : string.Empty, controlpropertyBag); controlHTMLEmitter.Emit(out controlHTMLString); return(MvcHtmlString.Create(controlHTMLString)); }
public override void Fill(ShuttlePropertyBag propertyBag, FillerParams fillerParam) { propertyBag.ControlName = fillerParam.ControlName; IControlDefaultPropertyBag controlDefault = ReadDefaultConfiguration(ControlNames.BallyShuttle); if (controlDefault != null) { propertyBag.CssClass = controlDefault.CssClass; propertyBag.ValidationErrorCssClass = controlDefault.ValidationErrorCssClass; propertyBag.ControlErrorCssClass = controlDefault.ControlErrorCssClass; } }
public override void Fill(ShuttlePropertyBag propertyBag, FillerParams fillerParams) { fillValidators(propertyBag, fillerParams); }
public ShuttleHTMLEmitter(string value, ShuttlePropertyBag propertyBag) : base(propertyBag.Validators, propertyBag.Mandatory) { this._propertyBag = propertyBag; this.Value = value; }
public virtual void Fill(ShuttlePropertyBag propertyBag, FillerParams fillerParams) { }