Exemplo n.º 1
0
 public void SetParameters(IHtmlContent content,
                           StandardButtons submitButton,
                           string controlType,
                           string headerBarName,
                           string footerBarName,
                           string submitBarName,
                           string name)
 {
     MainContent         = content;
     SubmitButton        = submitButton;
     ControlType         = controlType;
     HeaderBarName       = headerBarName;
     FooterBarName       = footerBarName;
     SubmitButton        = submitButton;
     Name                = name;
     OperationParameters = combinePrefixes(OperationParameters, TransformationsRegister.GetPrefix <JsonTransformation <QueryDescription> >());
 }
        public IHtmlContent RenderButton(StandardButtons buttonType,
                                         string arguments,
                                         string cssClass,
                                         ContextualizedHelpers helpers,
                                         IStringLocalizer localizer,
                                         bool visibleText   = false,
                                         bool isSubmit      = false,
                                         string controlType = null)
        {
            ButtonProperties currentButton = null;

            allButtonProperties.TryGetValue(buttonType, out currentButton);
            if (currentButton == null)
            {
                return(new HtmlString(string.Empty));
            }
            if (isSubmit)
            {
                return(new HtmlString(string.Format(visibleText ? buttonTemplateWithTextSubmit: buttonTemplateSubmit,
                                                    cssClass ?? string.Empty,
                                                    localizer != null ?
                                                    localizer[currentButton.ShowText] : currentButton.ShowText,
                                                    currentButton.IconClass
                                                    )));
            }
            else
            {
                return(new HtmlString(string.Format(visibleText ? buttonTemplateWithText : buttonTemplate,
                                                    currentButton.OperationName,
                                                    arguments ?? string.Empty,
                                                    cssClass ?? string.Empty,
                                                    localizer != null ?
                                                    localizer[currentButton.ShowText] : currentButton.ShowText,
                                                    currentButton.IconClass,
                                                    controlType == null ? string.Empty : "data-control-type='" + controlType + "'"
                                                    )));
            }
        }
 public  IHtmlContent RenderButton(StandardButtons buttonType, 
     string arguments, 
     string cssClass, 
     ContextualizedHelpers helpers, 
     IStringLocalizer localizer, 
     bool visibleText=false, 
     bool isSubmit=false,
     string controlType = null)
 {
     ButtonProperties currentButton = null;
     allButtonProperties.TryGetValue(buttonType, out currentButton);
     if(currentButton == null) return new HtmlString(string.Empty);
     if(isSubmit)
         return new HtmlString(string.Format(visibleText ? buttonTemplateWithTextSubmit: buttonTemplateSubmit,
             cssClass??string.Empty,
             localizer != null ?
                 localizer[currentButton.ShowText] : currentButton.ShowText,
             currentButton.IconClass
             ));
     else
         return new HtmlString(string.Format(visibleText ? buttonTemplateWithText : buttonTemplate,
             currentButton.OperationName,
             arguments ?? string.Empty,
             cssClass ?? string.Empty,
             localizer != null ?
                 localizer[currentButton.ShowText] : currentButton.ShowText,
             currentButton.IconClass,
             controlType==null ? string.Empty : "data-control-type='"+ controlType + "'"
             ));
 }
Exemplo n.º 4
0
 public IHtmlContent RenderButton(StandardButtons buttonType, string arguments, string cssClass, ContextualizedHelpers helpers, IStringLocalizer localizer, bool visibleText = false, bool isSubmit = false, string controlType = null)
 {
     return(new HtmlString(string.Empty));
 }