Ejemplo n.º 1
0
 public static void FirstDayOfYear(
     DateTime arg,
     [InvokerParameterName] string argName)
 {
     if (arg != arg.FirstDayOfYear())
     {
         throw DateTimeCodeExceptions.ArgumentNotFirstDayOfYear(argName, arg);
     }
 }
Ejemplo n.º 2
0
 public static void DateOnly(
     DateTime arg,
     [InvokerParameterName] string argName)
 {
     if (arg.TimeOfDay > TimeSpan.Zero)
     {
         throw DateTimeCodeExceptions.ArgumentWithTime(argName, arg);
     }
 }
Ejemplo n.º 3
0
 public static void IsUtc(
     DateTime arg,
     [InvokerParameterName] string argName)
 {
     if (arg.Kind != DateTimeKind.Utc)
     {
         throw DateTimeCodeExceptions.ArgumentNotUtc(argName, arg);
     }
 }
Ejemplo n.º 4
0
 public static void LastDayOfMonth(
     DateTime arg,
     [InvokerParameterName] string argName)
 {
     if (arg != arg.LastDayOfMonth())
     {
         throw DateTimeCodeExceptions.ArgumentNotLastDayOfMonth(argName, arg);
     }
 }
Ejemplo n.º 5
0
 public static void FirstDayOfMonth(
     DateTimeOffset arg,
     [NotNull, InvokerParameterName] string argName)
 {
     if (arg != arg.FirstDayOfMonth())
     {
         throw DateTimeCodeExceptions.ArgumentNotFirstDayOfMonth(argName, arg);
     }
 }
Ejemplo n.º 6
0
 public static void IsUtc(
     DateTimeOffset arg,
     [NotNull, InvokerParameterName] string argName)
 {
     if (!arg.IsUtc())
     {
         throw DateTimeCodeExceptions.ArgumentNotUtc(argName, arg);
     }
 }
Ejemplo n.º 7
0
 public static void LastDayOfYear(
     DateTimeOffset arg,
     [NotNull, InvokerParameterName] string argName)
 {
     if (arg != arg.LastDayOfYear())
     {
         throw DateTimeCodeExceptions.ArgumentNotLastDayOfYear(argName, arg);
     }
 }
Ejemplo n.º 8
0
 public static void IsUtcAndDateOnly(
     DateTimeOffset arg,
     [NotNull, InvokerParameterName] string argName)
 {
     if (!arg.IsUtc())
     {
         throw DateTimeCodeExceptions.ArgumentNotUtc(argName, arg);
     }
     if (arg.TimeOfDay > TimeSpan.Zero)
     {
         throw DateTimeCodeExceptions.ArgumentWithTime(argName, arg);
     }
 }