public IViewComponentResult Invoke( ILocalizableString text, string name, string icon, string id, ILocalizableString busyText, FontIconType iconType, AbpButtonType type, AbpButtonSize size, bool disabled) { Check.NotNull(text, nameof(text)); return(View( "~/Pages/Shared/Components/AbpPageToolbar/Button/Default.cshtml", new AbpPageToolbarButtonViewModel( text.Localize(StringLocalizerFactory), name, icon, id, busyText?.Localize(StringLocalizerFactory), iconType, type, size, disabled ) )); }
public static string ToClassName(this AbpButtonSize size) { switch (size) { case AbpButtonSize.Small: return("btn-sm"); case AbpButtonSize.Medium: return("btn-md"); case AbpButtonSize.Large: return("btn-lg"); case AbpButtonSize.Block: return("btn-block"); case AbpButtonSize.Block_Small: return("btn-sm btn-block"); case AbpButtonSize.Block_Medium: return("btn-md btn-block"); case AbpButtonSize.Block_Large: return("btn-lg btn-block"); case AbpButtonSize.Default: return(""); default: throw new AbpException($"Unknown {nameof(AbpButtonSize)}: {size}"); } }
public AbpPageToolbarButtonViewModel( string text, string name, string icon, string id, string busyText, FontIconType iconType, AbpButtonType type, AbpButtonSize size, bool disabled) { Text = text; Name = name; Icon = icon; Id = id; BusyText = busyText; IconType = iconType; Type = type; Size = size; Disabled = disabled; }
public static PageToolbar AddButton( this PageToolbar toolbar, ILocalizableString text, string icon = null, string name = null, string id = null, ILocalizableString busyText = null, FontIconType iconType = FontIconType.FontAwesome, AbpButtonType type = AbpButtonType.Primary, AbpButtonSize size = AbpButtonSize.Small, bool disabled = false, int order = 0, string requiredPolicyName = null) { if (busyText == null) { busyText = new LocalizableString(typeof(AbpUiResource), "ProcessingWithThreeDot"); } toolbar.AddComponent <AbpPageToolbarButtonViewComponent>( new { text, icon, name, id, busyText, iconType, type, size, disabled }, order, requiredPolicyName ); return(toolbar); }