示例#1
0
 internal static void Accept(this ControlPropertyBag propertyBag, ControlPropertyFiller[] fillers)
 {
     foreach (var filler in fillers)
     {
         propertyBag.Accept(filler);
     }
 }
        private void FillLiteral(ControlPropertyBag propertyBag, FillerParams fillerParams, bool skipWatermark=false)
        {
            string externalizationKey = string.Empty;
            if (fillerParams.IsBindingControl)
            {
                IModelPropertyConfiguration propertyConfig = ReadPropertyConfiguration(fillerParams.ModelName, fillerParams.PropertyName, fillerParams.ConfigKey);
                externalizationKey = propertyConfig != null ? propertyConfig.ExternalizationKey : string.Format(ControlLibConstants.EXTERNALIZATION_KEY_FORMAT, fillerParams.ModelName, fillerParams.PropertyName.Replace(".", "_"));
            }
            else
            {
                externalizationKey = fillerParams.ExternalizationKey;
            }

            propertyBag.Label = ControlLibraryConfig.ResourceService.GetLiteral(string.Format(ControlLibConstants.LABEL_FORMAT, externalizationKey));
            propertyBag.ToolTip = ControlLibraryConfig.ResourceService.GetLiteral(string.Format(ControlLibConstants.TOOLTIP_FORMAT, externalizationKey));
            if (!skipWatermark)
            {
                propertyBag.WaterMarkText = ControlLibraryConfig.ResourceService.GetLiteral(string.Format(ControlLibConstants.WATERMARK_FORMAT, externalizationKey));
            }
        }
        private void FillLiteral(ControlPropertyBag propertyBag, FillerParams fillerParams, bool skipWatermark = false)
        {
            string externalizationKey = string.Empty;

            if (fillerParams.IsBindingControl)
            {
                IModelPropertyConfiguration propertyConfig = ReadPropertyConfiguration(fillerParams.ModelName, fillerParams.PropertyName, fillerParams.ConfigKey);
                externalizationKey = propertyConfig != null ? propertyConfig.ExternalizationKey : string.Format(ControlLibConstants.EXTERNALIZATION_KEY_FORMAT, fillerParams.ModelName, fillerParams.PropertyName.Replace(".", "_"));
            }
            else
            {
                externalizationKey = fillerParams.ExternalizationKey;
            }

            propertyBag.Label   = ControlLibraryConfig.ResourceService.GetLiteral(string.Format(ControlLibConstants.LABEL_FORMAT, externalizationKey));
            propertyBag.ToolTip = ControlLibraryConfig.ResourceService.GetLiteral(string.Format(ControlLibConstants.TOOLTIP_FORMAT, externalizationKey));
            if (!skipWatermark)
            {
                propertyBag.WaterMarkText = ControlLibraryConfig.ResourceService.GetLiteral(string.Format(ControlLibConstants.WATERMARK_FORMAT, externalizationKey));
            }
        }