internal static IEnumerable<Control> GetIconAndTextControls( ActionControlIcon icon, string text ) { // Use a label because our CSS selectors for icons include first-child and last-child and these do not take into account "text nodes", i.e. text that is // interspersed with elements. var textControl = text.GetLabelControl(); if( icon == null ) return textControl.ToSingleElementArray(); if( icon.placement == ActionControlIconPlacement.Left ) return new Control[] { icon.icon, textControl }; if( icon.placement == ActionControlIconPlacement.Right ) return new Control[] { textControl, icon.icon }; throw new ApplicationException( "unknown placement" ); }
internal static IEnumerable <Control> GetIconAndTextControls(ActionControlIcon icon, string text) { // Use a label because our CSS selectors for icons include first-child and last-child and these do not take into account "text nodes", i.e. text that is // interspersed with elements. var textControl = text.GetLabelControl(); if (icon == null) { return(textControl.ToSingleElementArray()); } if (icon.placement == ActionControlIconPlacement.Left) { return new Control[] { icon.icon, textControl } } ; if (icon.placement == ActionControlIconPlacement.Right) { return new Control[] { textControl, icon.icon } } ; throw new ApplicationException("unknown placement"); }
/// <summary> /// NOTE: This method will be deleted when RSIS Goal 925 is completed. But continue using it when necessary since there is no good alternative. /// </summary> public static ActionButtonSetup CreateWithUrl( string text, ResourceInfo resourceInfo, ActionControlIcon icon = null ) { return new ActionButtonSetup( text, new EwfLink( resourceInfo ), icon: icon ); }
/// <summary> /// Creates an action button with the given behavior (ActionControl). The ActionControlStyle of the given actionControl will be overwritten. /// </summary> public ActionButtonSetup( string text, ActionControl actionControl, ActionControlIcon icon = null ) { this.text = text; this.icon = icon; this.actionControl = actionControl; }
/// <summary> /// Creates an action button with the given behavior (ActionControl). The ActionControlStyle of the given actionControl will be overwritten. /// </summary> public ActionButtonSetup(string text, ActionControl actionControl, ActionControlIcon icon = null) { this.text = text; this.icon = icon; this.actionControl = actionControl; }
/// <summary> /// NOTE: This method will be deleted when RSIS Goal 925 is completed. But continue using it when necessary since there is no good alternative. /// </summary> public static ActionButtonSetup CreateWithUrl(string text, ResourceInfo resourceInfo, ActionControlIcon icon = null) { return(new ActionButtonSetup(text, new EwfLink(resourceInfo), icon: icon)); }