Example #1
0
 public static bool IsValid(CornerRadius cornerRadius, bool allowNegative, bool allowNaN,
                            bool allowPositiveInfinity, bool allowNegativeInfinity)
 {
     return((allowNegative || cornerRadius.TopLeft >= 0.0 && cornerRadius.TopRight >= 0.0 &&
             (cornerRadius.BottomLeft >= 0.0 && cornerRadius.BottomRight >= 0.0)) &&
            (allowNaN || !DoubleUtilHelper.IsNaN(cornerRadius.TopLeft) && !DoubleUtilHelper.IsNaN(cornerRadius.TopRight) &&
             (!DoubleUtilHelper.IsNaN(cornerRadius.BottomLeft) && !DoubleUtilHelper.IsNaN(cornerRadius.BottomRight))) &&
            ((allowPositiveInfinity || !double.IsPositiveInfinity(cornerRadius.TopLeft) &&
              !double.IsPositiveInfinity(cornerRadius.TopRight) &&
              (!double.IsPositiveInfinity(cornerRadius.BottomLeft) && !double.IsPositiveInfinity(cornerRadius.BottomRight))) &&
             (allowNegativeInfinity || !double.IsNegativeInfinity(cornerRadius.TopLeft) &&
              !double.IsNegativeInfinity(cornerRadius.TopRight) &&
              (!double.IsNegativeInfinity(cornerRadius.BottomLeft) && !double.IsNegativeInfinity(cornerRadius.BottomRight)))));
 }
Example #2
0
 public static bool IsValid(Thickness thickness, bool allowNegative, bool allowNaN, bool allowPositiveInfinity,
                            bool allowNegativeInfinity)
 {
     return((allowNegative || thickness.Left >= 0.0 && thickness.Right >= 0.0 &&
             (thickness.Top >= 0.0 && thickness.Bottom >= 0.0)) &&
            (allowNaN || !DoubleUtilHelper.IsNaN(thickness.Left) && !DoubleUtilHelper.IsNaN(thickness.Right) &&
             (!DoubleUtilHelper.IsNaN(thickness.Top) && !DoubleUtilHelper.IsNaN(thickness.Bottom))) &&
            ((allowPositiveInfinity || !double.IsPositiveInfinity(thickness.Left) &&
              !double.IsPositiveInfinity(thickness.Right) &&
              (!double.IsPositiveInfinity(thickness.Top) && !double.IsPositiveInfinity(thickness.Bottom))) &&
             (allowNegativeInfinity || !double.IsNegativeInfinity(thickness.Left) &&
              !double.IsNegativeInfinity(thickness.Right) &&
              (!double.IsNegativeInfinity(thickness.Top) && !double.IsNegativeInfinity(thickness.Bottom)))));
 }