Skip to content

Commit bb28f94

Browse files
tmilnthorpangularsen
authored andcommitted
Moving code that is not valid in WRC from Common code to NetFramework… (#460)
* Moving code that is not valid in WRC from Common code to NetFramework code * Whitespace touchup
1 parent fe89064 commit bb28f94

File tree

183 files changed

+14564
-21493
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+14564
-21493
lines changed

UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs

Lines changed: 0 additions & 296 deletions
Original file line numberDiff line numberDiff line change
@@ -395,204 +395,6 @@ public static Acceleration FromStandardGravity(QuantityValue standardgravity)
395395
return new Acceleration(value, AccelerationUnit.StandardGravity);
396396
}
397397

398-
// Windows Runtime Component does not support nullable types (double?): https://msdn.microsoft.com/en-us/library/br230301.aspx
399-
#if !WINDOWS_UWP
400-
/// <summary>
401-
/// Get nullable Acceleration from nullable CentimetersPerSecondSquared.
402-
/// </summary>
403-
public static Acceleration? FromCentimetersPerSecondSquared(QuantityValue? centimeterspersecondsquared)
404-
{
405-
if (centimeterspersecondsquared.HasValue)
406-
{
407-
return FromCentimetersPerSecondSquared(centimeterspersecondsquared.Value);
408-
}
409-
else
410-
{
411-
return null;
412-
}
413-
}
414-
415-
/// <summary>
416-
/// Get nullable Acceleration from nullable DecimetersPerSecondSquared.
417-
/// </summary>
418-
public static Acceleration? FromDecimetersPerSecondSquared(QuantityValue? decimeterspersecondsquared)
419-
{
420-
if (decimeterspersecondsquared.HasValue)
421-
{
422-
return FromDecimetersPerSecondSquared(decimeterspersecondsquared.Value);
423-
}
424-
else
425-
{
426-
return null;
427-
}
428-
}
429-
430-
/// <summary>
431-
/// Get nullable Acceleration from nullable FeetPerSecondSquared.
432-
/// </summary>
433-
public static Acceleration? FromFeetPerSecondSquared(QuantityValue? feetpersecondsquared)
434-
{
435-
if (feetpersecondsquared.HasValue)
436-
{
437-
return FromFeetPerSecondSquared(feetpersecondsquared.Value);
438-
}
439-
else
440-
{
441-
return null;
442-
}
443-
}
444-
445-
/// <summary>
446-
/// Get nullable Acceleration from nullable InchesPerSecondSquared.
447-
/// </summary>
448-
public static Acceleration? FromInchesPerSecondSquared(QuantityValue? inchespersecondsquared)
449-
{
450-
if (inchespersecondsquared.HasValue)
451-
{
452-
return FromInchesPerSecondSquared(inchespersecondsquared.Value);
453-
}
454-
else
455-
{
456-
return null;
457-
}
458-
}
459-
460-
/// <summary>
461-
/// Get nullable Acceleration from nullable KilometersPerSecondSquared.
462-
/// </summary>
463-
public static Acceleration? FromKilometersPerSecondSquared(QuantityValue? kilometerspersecondsquared)
464-
{
465-
if (kilometerspersecondsquared.HasValue)
466-
{
467-
return FromKilometersPerSecondSquared(kilometerspersecondsquared.Value);
468-
}
469-
else
470-
{
471-
return null;
472-
}
473-
}
474-
475-
/// <summary>
476-
/// Get nullable Acceleration from nullable KnotsPerHour.
477-
/// </summary>
478-
public static Acceleration? FromKnotsPerHour(QuantityValue? knotsperhour)
479-
{
480-
if (knotsperhour.HasValue)
481-
{
482-
return FromKnotsPerHour(knotsperhour.Value);
483-
}
484-
else
485-
{
486-
return null;
487-
}
488-
}
489-
490-
/// <summary>
491-
/// Get nullable Acceleration from nullable KnotsPerMinute.
492-
/// </summary>
493-
public static Acceleration? FromKnotsPerMinute(QuantityValue? knotsperminute)
494-
{
495-
if (knotsperminute.HasValue)
496-
{
497-
return FromKnotsPerMinute(knotsperminute.Value);
498-
}
499-
else
500-
{
501-
return null;
502-
}
503-
}
504-
505-
/// <summary>
506-
/// Get nullable Acceleration from nullable KnotsPerSecond.
507-
/// </summary>
508-
public static Acceleration? FromKnotsPerSecond(QuantityValue? knotspersecond)
509-
{
510-
if (knotspersecond.HasValue)
511-
{
512-
return FromKnotsPerSecond(knotspersecond.Value);
513-
}
514-
else
515-
{
516-
return null;
517-
}
518-
}
519-
520-
/// <summary>
521-
/// Get nullable Acceleration from nullable MetersPerSecondSquared.
522-
/// </summary>
523-
public static Acceleration? FromMetersPerSecondSquared(QuantityValue? meterspersecondsquared)
524-
{
525-
if (meterspersecondsquared.HasValue)
526-
{
527-
return FromMetersPerSecondSquared(meterspersecondsquared.Value);
528-
}
529-
else
530-
{
531-
return null;
532-
}
533-
}
534-
535-
/// <summary>
536-
/// Get nullable Acceleration from nullable MicrometersPerSecondSquared.
537-
/// </summary>
538-
public static Acceleration? FromMicrometersPerSecondSquared(QuantityValue? micrometerspersecondsquared)
539-
{
540-
if (micrometerspersecondsquared.HasValue)
541-
{
542-
return FromMicrometersPerSecondSquared(micrometerspersecondsquared.Value);
543-
}
544-
else
545-
{
546-
return null;
547-
}
548-
}
549-
550-
/// <summary>
551-
/// Get nullable Acceleration from nullable MillimetersPerSecondSquared.
552-
/// </summary>
553-
public static Acceleration? FromMillimetersPerSecondSquared(QuantityValue? millimeterspersecondsquared)
554-
{
555-
if (millimeterspersecondsquared.HasValue)
556-
{
557-
return FromMillimetersPerSecondSquared(millimeterspersecondsquared.Value);
558-
}
559-
else
560-
{
561-
return null;
562-
}
563-
}
564-
565-
/// <summary>
566-
/// Get nullable Acceleration from nullable NanometersPerSecondSquared.
567-
/// </summary>
568-
public static Acceleration? FromNanometersPerSecondSquared(QuantityValue? nanometerspersecondsquared)
569-
{
570-
if (nanometerspersecondsquared.HasValue)
571-
{
572-
return FromNanometersPerSecondSquared(nanometerspersecondsquared.Value);
573-
}
574-
else
575-
{
576-
return null;
577-
}
578-
}
579-
580-
/// <summary>
581-
/// Get nullable Acceleration from nullable StandardGravity.
582-
/// </summary>
583-
public static Acceleration? FromStandardGravity(QuantityValue? standardgravity)
584-
{
585-
if (standardgravity.HasValue)
586-
{
587-
return FromStandardGravity(standardgravity.Value);
588-
}
589-
else
590-
{
591-
return null;
592-
}
593-
}
594-
595-
#endif
596398

597399
/// <summary>
598400
/// Dynamically convert from value and unit enum <see cref="AccelerationUnit" /> to <see cref="Acceleration" />.
@@ -611,25 +413,6 @@ public static Acceleration From(QuantityValue value, AccelerationUnit fromUnit)
611413
return new Acceleration((double)value, fromUnit);
612414
}
613415

614-
// Windows Runtime Component does not support nullable types (double?): https://msdn.microsoft.com/en-us/library/br230301.aspx
615-
#if !WINDOWS_UWP
616-
/// <summary>
617-
/// Dynamically convert from value and unit enum <see cref="AccelerationUnit" /> to <see cref="Acceleration" />.
618-
/// </summary>
619-
/// <param name="value">Value to convert from.</param>
620-
/// <param name="fromUnit">Unit to convert from.</param>
621-
/// <returns>Acceleration unit value.</returns>
622-
public static Acceleration? From(QuantityValue? value, AccelerationUnit fromUnit)
623-
{
624-
if (!value.HasValue)
625-
{
626-
return null;
627-
}
628-
629-
return new Acceleration((double)value.Value, fromUnit);
630-
}
631-
#endif
632-
633416
/// <summary>
634417
/// Get unit abbreviation string.
635418
/// </summary>
@@ -672,48 +455,6 @@ public static string GetAbbreviation(
672455

673456
#endregion
674457

675-
#region Arithmetic Operators
676-
677-
// Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx
678-
#if !WINDOWS_UWP
679-
public static Acceleration operator -(Acceleration right)
680-
{
681-
return new Acceleration(-right.Value, right.Unit);
682-
}
683-
684-
public static Acceleration operator +(Acceleration left, Acceleration right)
685-
{
686-
return new Acceleration(left.Value + right.AsBaseNumericType(left.Unit), left.Unit);
687-
}
688-
689-
public static Acceleration operator -(Acceleration left, Acceleration right)
690-
{
691-
return new Acceleration(left.Value - right.AsBaseNumericType(left.Unit), left.Unit);
692-
}
693-
694-
public static Acceleration operator *(double left, Acceleration right)
695-
{
696-
return new Acceleration(left * right.Value, right.Unit);
697-
}
698-
699-
public static Acceleration operator *(Acceleration left, double right)
700-
{
701-
return new Acceleration(left.Value * right, left.Unit);
702-
}
703-
704-
public static Acceleration operator /(Acceleration left, double right)
705-
{
706-
return new Acceleration(left.Value / right, left.Unit);
707-
}
708-
709-
public static double operator /(Acceleration left, Acceleration right)
710-
{
711-
return left.MetersPerSecondSquared / right.MetersPerSecondSquared;
712-
}
713-
#endif
714-
715-
#endregion
716-
717458
#region Equality / IComparable
718459

719460
public int CompareTo(object obj)
@@ -735,43 +476,6 @@ int CompareTo(Acceleration other)
735476
return _value.CompareTo(other.AsBaseNumericType(this.Unit));
736477
}
737478

738-
// Windows Runtime Component does not allow operator overloads: https://msdn.microsoft.com/en-us/library/br230301.aspx
739-
#if !WINDOWS_UWP
740-
public static bool operator <=(Acceleration left, Acceleration right)
741-
{
742-
return left.Value <= right.AsBaseNumericType(left.Unit);
743-
}
744-
745-
public static bool operator >=(Acceleration left, Acceleration right)
746-
{
747-
return left.Value >= right.AsBaseNumericType(left.Unit);
748-
}
749-
750-
public static bool operator <(Acceleration left, Acceleration right)
751-
{
752-
return left.Value < right.AsBaseNumericType(left.Unit);
753-
}
754-
755-
public static bool operator >(Acceleration left, Acceleration right)
756-
{
757-
return left.Value > right.AsBaseNumericType(left.Unit);
758-
}
759-
760-
[Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")]
761-
public static bool operator ==(Acceleration left, Acceleration right)
762-
{
763-
// ReSharper disable once CompareOfFloatsByEqualityOperator
764-
return left.Value == right.AsBaseNumericType(left.Unit);
765-
}
766-
767-
[Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")]
768-
public static bool operator !=(Acceleration left, Acceleration right)
769-
{
770-
// ReSharper disable once CompareOfFloatsByEqualityOperator
771-
return left.Value != right.AsBaseNumericType(left.Unit);
772-
}
773-
#endif
774-
775479
[Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")]
776480
public override bool Equals(object obj)
777481
{

0 commit comments

Comments
 (0)