Example #1
0
 public string GetLineBreakClass(SupportedGridSystems gs, bool edit, int level)
 {
     string[] allClasses = gs == SupportedGridSystems.Bootstrap3 ? bootstrap3Visibility : bootstrap4Visibility;
     bool[]   allEnds;
     if (edit)
     {
         allEnds = EditDetailEndRow;
     }
     else
     {
         allEnds = DisplayDetailEndRow;
     }
     if (allEnds == null || allEnds.Length == 0)
     {
         return(null);
     }
     if (level < 0)
     {
         level = 0;
     }
     else if (level >= allEnds.Length)
     {
         return(null);
     }
     return(allEnds[level] ? allClasses[level] : null);
 }
Example #2
0
        public string GetTotalClass(SupportedGridSystems gs, bool edit)
        {
            string[] allStyles;

            var cssClass = ColumnCssClass ?? "form-group";

            var currWidths = edit ? EditDetailWidths : DisplayDetailWidths;

            if (currWidths != null && currWidths.Length > 0)
            {
                if (gs == SupportedGridSystems.Bootstrap3)
                {
                    allStyles = bootstrap3Grid;
                }
                else if (gs == SupportedGridSystems.Bootstrap4)
                {
                    allStyles = bootstrap4Grid;
                }
                else
                {
                    throw new NotImplementedException();
                }
                var toBuild = new StringBuilder();
                toBuild.Append(cssClass);
                for (int i = 0; i < Math.Min(allStyles.Length, currWidths.Length); i++)
                {
                    if (currWidths[i] == 0 || (i != 0 && currWidths[i] == currWidths[i - 1]))
                    {
                        continue;
                    }
                    toBuild.Append(" ");
                    toBuild.Append(allStyles[i]);
                    toBuild.Append(currWidths[i].ToString(CultureInfo.InvariantCulture));
                }
                cssClass = toBuild.ToString();
            }
            else
            {
                cssClass += " col-xs-12";
            }
            return(cssClass);
        }