コード例 #1
0
ファイル: MatHiddenUtils.cs プロジェクト: vissol500/MatBlazor
 public static bool IsHidden(decimal width, MatBreakpoint breakpoint, MatHiddenDirection direction)
 {
     switch (direction)
     {
     case MatHiddenDirection.Down:
         return(breakpoint switch
         {
             MatBreakpoint.XS => width < (decimal)MatBreakpoint.SM,
             MatBreakpoint.SM => width < (decimal)MatBreakpoint.MD,
             MatBreakpoint.MD => width < (decimal)MatBreakpoint.LG,
             MatBreakpoint.LG => width < (decimal)MatBreakpoint.XL,
             MatBreakpoint.XL => true,
             _ => throw new ArgumentOutOfRangeException(nameof(breakpoint), breakpoint, null),
         });
コード例 #2
0
ファイル: MatHiddenUtils.cs プロジェクト: zimcoder/MatBlazor
        public static bool IsHidden(decimal width, MatBreakpoint breakpoint, MatHiddenDirection direction)
        {
            switch (direction)
            {
            case MatHiddenDirection.Down:
                switch (breakpoint)
                {
                case MatBreakpoint.XS:
                    return(width < (decimal)MatBreakpoint.SM);

                case MatBreakpoint.SM:
                    return(width < (decimal)MatBreakpoint.MD);

                case MatBreakpoint.MD:
                    return(width < (decimal)MatBreakpoint.LG);

                case MatBreakpoint.LG:
                    return(width < (decimal)MatBreakpoint.XL);

                case MatBreakpoint.XL:
                    return(true);

                default:
                    throw new ArgumentOutOfRangeException(nameof(breakpoint), breakpoint, null);
                }

                break;

            case MatHiddenDirection.Up:
                return(width >= (decimal)breakpoint);

                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(direction), direction, null);
            }
        }