Removed duplicate UnitConverter.g.cs.

Removed duplicate UnitConverter.g.cs.

--- Src/UnitsNet/UnitConverter.g.cs
+++ Src/UnitsNet/UnitConverter.g.cs
@@ -1,993 +0,0 @@
-// Copyright © 2007 by Initial Force AS.  All rights reserved.
-// https://github.com/InitialForce/SIUnits
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-
-namespace UnitsNet
-{
-    /// <summary>
-    /// Dynamically convert between compatible units only known at runtime.
-    /// </summary>
-    public static class UnitConverter
-    {
-        /// <summary>
-        /// Dynamically convert between two compatible units only known at runtime, such as converting from millimeters to meters.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="fromUnit">Unit to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <returns>Value in new unit.</returns>
-        /// <exception cref="Exception">If the two units are not compatible.</exception>
-        public static double Convert(double value, Unit fromUnit, Unit toUnit)
-        {
-            if (fromUnit == toUnit)
-                return value;
-
-            double newValue;
-            if (TryConvertFromAngle(value, fromUnit, toUnit, out newValue)) return newValue;
-            if (TryConvertFromArea(value, fromUnit, toUnit, out newValue)) return newValue;
-            if (TryConvertFromElectricPotential(value, fromUnit, toUnit, out newValue)) return newValue;
-            if (TryConvertFromFlow(value, fromUnit, toUnit, out newValue)) return newValue;
-            if (TryConvertFromForce(value, fromUnit, toUnit, out newValue)) return newValue;
-            if (TryConvertFromLength(value, fromUnit, toUnit, out newValue)) return newValue;
-            if (TryConvertFromMass(value, fromUnit, toUnit, out newValue)) return newValue;
-            if (TryConvertFromPressure(value, fromUnit, toUnit, out newValue)) return newValue;
-            if (TryConvertFromRotationalSpeed(value, fromUnit, toUnit, out newValue)) return newValue;
-            if (TryConvertFromTorque(value, fromUnit, toUnit, out newValue)) return newValue;
-            if (TryConvertFromVolume(value, fromUnit, toUnit, out newValue)) return newValue;
-
-            throw new Exception(
-                string.Format("Conversion from unit [{0}] to [{1}] is either not valid or not yet implemented.",
-                              fromUnit, toUnit));
-        }
-
-        /// <summary>
-        /// Dynamically convert between two compatible units only known at runtime, such as converting from millimeters to meters.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="fromUnit">Unit to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        public static bool TryConvert(double value, Unit fromUnit, Unit toUnit, out double newValue)
-        {
-            if (fromUnit == toUnit)
-            {
-                newValue = value;
-                return true;
-            }
-
-            if (TryConvertFromAngle(value, fromUnit, toUnit, out newValue)) return true;
-            if (TryConvertFromArea(value, fromUnit, toUnit, out newValue)) return true;
-            if (TryConvertFromElectricPotential(value, fromUnit, toUnit, out newValue)) return true;
-            if (TryConvertFromFlow(value, fromUnit, toUnit, out newValue)) return true;
-            if (TryConvertFromForce(value, fromUnit, toUnit, out newValue)) return true;
-            if (TryConvertFromLength(value, fromUnit, toUnit, out newValue)) return true;
-            if (TryConvertFromMass(value, fromUnit, toUnit, out newValue)) return true;
-            if (TryConvertFromPressure(value, fromUnit, toUnit, out newValue)) return true;
-            if (TryConvertFromRotationalSpeed(value, fromUnit, toUnit, out newValue)) return true;
-            if (TryConvertFromTorque(value, fromUnit, toUnit, out newValue)) return true;
-            if (TryConvertFromVolume(value, fromUnit, toUnit, out newValue)) return true;
-
-            return false;
-        }
-
-        #region Private
-
-
-        /// <summary>
-        /// Try to dynamically convert from Angle to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="fromUnit">Unit to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvertFromAngle(double value, Unit fromUnit, Unit toUnit, out double newValue)
-        {
-            switch (fromUnit)
-            {
-                case Unit.Radian:
-                    return TryConvert(Angle.FromRadians(value), toUnit, out newValue);
-                case Unit.Degree:
-                    return TryConvert(Angle.FromDegrees(value), toUnit, out newValue);
-                case Unit.Gradian:
-                    return TryConvert(Angle.FromGradians(value), toUnit, out newValue);
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-        /// <summary>
-        /// Try to dynamically convert from Area to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="fromUnit">Unit to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvertFromArea(double value, Unit fromUnit, Unit toUnit, out double newValue)
-        {
-            switch (fromUnit)
-            {
-                case Unit.SquareKilometer:
-                    return TryConvert(Area.FromSquareKilometers(value), toUnit, out newValue);
-                case Unit.SquareMeter:
-                    return TryConvert(Area.FromSquareMeters(value), toUnit, out newValue);
-                case Unit.SquareDecimeter:
-                    return TryConvert(Area.FromSquareDecimeters(value), toUnit, out newValue);
-                case Unit.SquareCentimeter:
-                    return TryConvert(Area.FromSquareCentimeters(value), toUnit, out newValue);
-                case Unit.SquareMillimeter:
-                    return TryConvert(Area.FromSquareMillimeters(value), toUnit, out newValue);
-                case Unit.SquareMile:
-                    return TryConvert(Area.FromSquareMiles(value), toUnit, out newValue);
-                case Unit.SquareYard:
-                    return TryConvert(Area.FromSquareYards(value), toUnit, out newValue);
-                case Unit.SquareFoot:
-                    return TryConvert(Area.FromSquareFeet(value), toUnit, out newValue);
-                case Unit.SquareInch:
-                    return TryConvert(Area.FromSquareInches(value), toUnit, out newValue);
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-        /// <summary>
-        /// Try to dynamically convert from ElectricPotential to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="fromUnit">Unit to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvertFromElectricPotential(double value, Unit fromUnit, Unit toUnit, out double newValue)
-        {
-            switch (fromUnit)
-            {
-                case Unit.Volt:
-                    return TryConvert(ElectricPotential.FromVolts(value), toUnit, out newValue);
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-        /// <summary>
-        /// Try to dynamically convert from Flow to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="fromUnit">Unit to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvertFromFlow(double value, Unit fromUnit, Unit toUnit, out double newValue)
-        {
-            switch (fromUnit)
-            {
-                case Unit.CubicMeterPerSecond:
-                    return TryConvert(Flow.FromCubicMetersPerSecond(value), toUnit, out newValue);
-                case Unit.CubicMeterPerHour:
-                    return TryConvert(Flow.FromCubicMetersPerHour(value), toUnit, out newValue);
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-        /// <summary>
-        /// Try to dynamically convert from Force to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="fromUnit">Unit to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvertFromForce(double value, Unit fromUnit, Unit toUnit, out double newValue)
-        {
-            switch (fromUnit)
-            {
-                case Unit.Kilonewton:
-                    return TryConvert(Force.FromKilonewtons(value), toUnit, out newValue);
-                case Unit.KilogramForce:
-                    return TryConvert(Force.FromKilogramsForce(value), toUnit, out newValue);
-                case Unit.Newton:
-                    return TryConvert(Force.FromNewtons(value), toUnit, out newValue);
-                case Unit.Dyn:
-                    return TryConvert(Force.FromDyne(value), toUnit, out newValue);
-                case Unit.KiloPond:
-                    return TryConvert(Force.FromKiloPonds(value), toUnit, out newValue);
-                case Unit.PoundForce:
-                    return TryConvert(Force.FromPoundForces(value), toUnit, out newValue);
-                case Unit.Poundal:
-                    return TryConvert(Force.FromPoundals(value), toUnit, out newValue);
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-        /// <summary>
-        /// Try to dynamically convert from Length to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="fromUnit">Unit to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvertFromLength(double value, Unit fromUnit, Unit toUnit, out double newValue)
-        {
-            switch (fromUnit)
-            {
-                case Unit.Kilometer:
-                    return TryConvert(Length.FromKilometers(value), toUnit, out newValue);
-                case Unit.Meter:
-                    return TryConvert(Length.FromMeters(value), toUnit, out newValue);
-                case Unit.Decimeter:
-                    return TryConvert(Length.FromDecimeters(value), toUnit, out newValue);
-                case Unit.Centimeter:
-                    return TryConvert(Length.FromCentimeters(value), toUnit, out newValue);
-                case Unit.Millimeter:
-                    return TryConvert(Length.FromMillimeters(value), toUnit, out newValue);
-                case Unit.Micrometer:
-                    return TryConvert(Length.FromMicrometers(value), toUnit, out newValue);
-                case Unit.Nanometer:
-                    return TryConvert(Length.FromNanometers(value), toUnit, out newValue);
-                case Unit.Mile:
-                    return TryConvert(Length.FromMiles(value), toUnit, out newValue);
-                case Unit.Yard:
-                    return TryConvert(Length.FromYards(value), toUnit, out newValue);
-                case Unit.Foot:
-                    return TryConvert(Length.FromFeet(value), toUnit, out newValue);
-                case Unit.Inch:
-                    return TryConvert(Length.FromInches(value), toUnit, out newValue);
-                case Unit.Mil:
-                    return TryConvert(Length.FromMils(value), toUnit, out newValue);
-                case Unit.Microinch:
-                    return TryConvert(Length.FromMicroinches(value), toUnit, out newValue);
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-        /// <summary>
-        /// Try to dynamically convert from Mass to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="fromUnit">Unit to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvertFromMass(double value, Unit fromUnit, Unit toUnit, out double newValue)
-        {
-            switch (fromUnit)
-            {
-                case Unit.Megatonne:
-                    return TryConvert(Mass.FromMegatonnes(value), toUnit, out newValue);
-                case Unit.Kilotonne:
-                    return TryConvert(Mass.FromKilotonnes(value), toUnit, out newValue);
-                case Unit.Tonne:
-                    return TryConvert(Mass.FromTonnes(value), toUnit, out newValue);
-                case Unit.Kilogram:
-                    return TryConvert(Mass.FromKilograms(value), toUnit, out newValue);
-                case Unit.Hectogram:
-                    return TryConvert(Mass.FromHectograms(value), toUnit, out newValue);
-                case Unit.Decagram:
-                    return TryConvert(Mass.FromDecagrams(value), toUnit, out newValue);
-                case Unit.Gram:
-                    return TryConvert(Mass.FromGrams(value), toUnit, out newValue);
-                case Unit.Decigram:
-                    return TryConvert(Mass.FromDecigrams(value), toUnit, out newValue);
-                case Unit.Centigram:
-                    return TryConvert(Mass.FromCentigrams(value), toUnit, out newValue);
-                case Unit.Milligram:
-                    return TryConvert(Mass.FromMilligrams(value), toUnit, out newValue);
-                case Unit.ShortTon:
-                    return TryConvert(Mass.FromShortTons(value), toUnit, out newValue);
-                case Unit.LongTon:
-                    return TryConvert(Mass.FromLongTons(value), toUnit, out newValue);
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-        /// <summary>
-        /// Try to dynamically convert from Pressure to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="fromUnit">Unit to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvertFromPressure(double value, Unit fromUnit, Unit toUnit, out double newValue)
-        {
-            switch (fromUnit)
-            {
-                case Unit.NewtonPerSquareMillimeter:
-                    return TryConvert(Pressure.FromNewtonsPerSquareMillimeter(value), toUnit, out newValue);
-                case Unit.NewtonPerSquareCentimeter:
-                    return TryConvert(Pressure.FromNewtonsPerSquareCentimeter(value), toUnit, out newValue);
-                case Unit.NewtonPerSquareMeter:
-                    return TryConvert(Pressure.FromNewtonsPerSquareMeter(value), toUnit, out newValue);
-                case Unit.KilogramForcePerSquareCentimeter:
-                    return TryConvert(Pressure.FromKilogramForcePerSquareCentimeter(value), toUnit, out newValue);
-                case Unit.Atmosphere:
-                    return TryConvert(Pressure.FromAtmospheres(value), toUnit, out newValue);
-                case Unit.TechnicalAtmosphere:
-                    return TryConvert(Pressure.FromTechnicalAtmospheres(value), toUnit, out newValue);
-                case Unit.Psi:
-                    return TryConvert(Pressure.FromPsi(value), toUnit, out newValue);
-                case Unit.Torr:
-                    return TryConvert(Pressure.FromTorrs(value), toUnit, out newValue);
-                case Unit.Bar:
-                    return TryConvert(Pressure.FromBars(value), toUnit, out newValue);
-                case Unit.Megapascal:
-                    return TryConvert(Pressure.FromMegapascals(value), toUnit, out newValue);
-                case Unit.Kilopascal:
-                    return TryConvert(Pressure.FromKilopascals(value), toUnit, out newValue);
-                case Unit.Pascal:
-                    return TryConvert(Pressure.FromPascals(value), toUnit, out newValue);
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-        /// <summary>
-        /// Try to dynamically convert from RotationalSpeed to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="fromUnit">Unit to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvertFromRotationalSpeed(double value, Unit fromUnit, Unit toUnit, out double newValue)
-        {
-            switch (fromUnit)
-            {
-                case Unit.RevolutionPerSecond:
-                    return TryConvert(RotationalSpeed.FromRevolutionsPerSecond(value), toUnit, out newValue);
-                case Unit.RevolutionPerMinute:
-                    return TryConvert(RotationalSpeed.FromRevolutionsPerMinute(value), toUnit, out newValue);
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-        /// <summary>
-        /// Try to dynamically convert from Torque to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="fromUnit">Unit to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvertFromTorque(double value, Unit fromUnit, Unit toUnit, out double newValue)
-        {
-            switch (fromUnit)
-            {
-                case Unit.Newtonmeter:
-                    return TryConvert(Torque.FromNewtonmeters(value), toUnit, out newValue);
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-        /// <summary>
-        /// Try to dynamically convert from Volume to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="fromUnit">Unit to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvertFromVolume(double value, Unit fromUnit, Unit toUnit, out double newValue)
-        {
-            switch (fromUnit)
-            {
-                case Unit.CubicKilometer:
-                    return TryConvert(Volume.FromCubicKilometers(value), toUnit, out newValue);
-                case Unit.CubicMeter:
-                    return TryConvert(Volume.FromCubicMeters(value), toUnit, out newValue);
-                case Unit.CubicDecimeter:
-                    return TryConvert(Volume.FromCubicDecimeters(value), toUnit, out newValue);
-                case Unit.CubicCentimeter:
-                    return TryConvert(Volume.FromCubicCentimeters(value), toUnit, out newValue);
-                case Unit.CubicMillimeter:
-                    return TryConvert(Volume.FromCubicMillimeters(value), toUnit, out newValue);
-                case Unit.Hectoliter:
-                    return TryConvert(Volume.FromHectoliters(value), toUnit, out newValue);
-                case Unit.Liter:
-                    return TryConvert(Volume.FromLiters(value), toUnit, out newValue);
-                case Unit.Deciliter:
-                    return TryConvert(Volume.FromDeciliters(value), toUnit, out newValue);
-                case Unit.Centiliter:
-                    return TryConvert(Volume.FromCentiliters(value), toUnit, out newValue);
-                case Unit.Milliliter:
-                    return TryConvert(Volume.FromMilliliters(value), toUnit, out newValue);
-                case Unit.CubicMile:
-                    return TryConvert(Volume.FromCubicMiles(value), toUnit, out newValue);
-                case Unit.CubicYard:
-                    return TryConvert(Volume.FromCubicYards(value), toUnit, out newValue);
-                case Unit.CubicFoot:
-                    return TryConvert(Volume.FromCubicFeet(value), toUnit, out newValue);
-                case Unit.CubicInch:
-                    return TryConvert(Volume.FromCubicInches(value), toUnit, out newValue);
-                case Unit.ImperialGallon:
-                    return TryConvert(Volume.FromImperialGallons(value), toUnit, out newValue);
-                case Unit.UsGallon:
-                    return TryConvert(Volume.FromUsGallons(value), toUnit, out newValue);
-                case Unit.UsOunce:
-                    return TryConvert(Volume.FromUsOunces(value), toUnit, out newValue);
-                case Unit.ImperialOunce:
-                    return TryConvert(Volume.FromImperialOunces(value), toUnit, out newValue);
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-        /// <summary>
-        /// Try to dynamically convert from Angle to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvert(Angle value, Unit toUnit, out double newValue)
-        {
-            switch (toUnit)
-            {
-                case Unit.Radian:
-                    newValue = value.Radians;
-                    return true;
-                case Unit.Degree:
-                    newValue = value.Degrees;
-                    return true;
-                case Unit.Gradian:
-                    newValue = value.Gradians;
-                    return true;
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-
-        /// <summary>
-        /// Try to dynamically convert from Area to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvert(Area value, Unit toUnit, out double newValue)
-        {
-            switch (toUnit)
-            {
-                case Unit.SquareKilometer:
-                    newValue = value.SquareKilometers;
-                    return true;
-                case Unit.SquareMeter:
-                    newValue = value.SquareMeters;
-                    return true;
-                case Unit.SquareDecimeter:
-                    newValue = value.SquareDecimeters;
-                    return true;
-                case Unit.SquareCentimeter:
-                    newValue = value.SquareCentimeters;
-                    return true;
-                case Unit.SquareMillimeter:
-                    newValue = value.SquareMillimeters;
-                    return true;
-                case Unit.SquareMile:
-                    newValue = value.SquareMiles;
-                    return true;
-                case Unit.SquareYard:
-                    newValue = value.SquareYards;
-                    return true;
-                case Unit.SquareFoot:
-                    newValue = value.SquareFeet;
-                    return true;
-                case Unit.SquareInch:
-                    newValue = value.SquareInches;
-                    return true;
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-
-        /// <summary>
-        /// Try to dynamically convert from ElectricPotential to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvert(ElectricPotential value, Unit toUnit, out double newValue)
-        {
-            switch (toUnit)
-            {
-                case Unit.Volt:
-                    newValue = value.Volts;
-                    return true;
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-
-        /// <summary>
-        /// Try to dynamically convert from Flow to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvert(Flow value, Unit toUnit, out double newValue)
-        {
-            switch (toUnit)
-            {
-                case Unit.CubicMeterPerSecond:
-                    newValue = value.CubicMetersPerSecond;
-                    return true;
-                case Unit.CubicMeterPerHour:
-                    newValue = value.CubicMetersPerHour;
-                    return true;
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-
-        /// <summary>
-        /// Try to dynamically convert from Force to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvert(Force value, Unit toUnit, out double newValue)
-        {
-            switch (toUnit)
-            {
-                case Unit.Kilonewton:
-                    newValue = value.Kilonewtons;
-                    return true;
-                case Unit.KilogramForce:
-                    newValue = value.KilogramsForce;
-                    return true;
-                case Unit.Newton:
-                    newValue = value.Newtons;
-                    return true;
-                case Unit.Dyn:
-                    newValue = value.Dyne;
-                    return true;
-                case Unit.KiloPond:
-                    newValue = value.KiloPonds;
-                    return true;
-                case Unit.PoundForce:
-                    newValue = value.PoundForces;
-                    return true;
-                case Unit.Poundal:
-                    newValue = value.Poundals;
-                    return true;
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-
-        /// <summary>
-        /// Try to dynamically convert from Length to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvert(Length value, Unit toUnit, out double newValue)
-        {
-            switch (toUnit)
-            {
-                case Unit.Kilometer:
-                    newValue = value.Kilometers;
-                    return true;
-                case Unit.Meter:
-                    newValue = value.Meters;
-                    return true;
-                case Unit.Decimeter:
-                    newValue = value.Decimeters;
-                    return true;
-                case Unit.Centimeter:
-                    newValue = value.Centimeters;
-                    return true;
-                case Unit.Millimeter:
-                    newValue = value.Millimeters;
-                    return true;
-                case Unit.Micrometer:
-                    newValue = value.Micrometers;
-                    return true;
-                case Unit.Nanometer:
-                    newValue = value.Nanometers;
-                    return true;
-                case Unit.Mile:
-                    newValue = value.Miles;
-                    return true;
-                case Unit.Yard:
-                    newValue = value.Yards;
-                    return true;
-                case Unit.Foot:
-                    newValue = value.Feet;
-                    return true;
-                case Unit.Inch:
-                    newValue = value.Inches;
-                    return true;
-                case Unit.Mil:
-                    newValue = value.Mils;
-                    return true;
-                case Unit.Microinch:
-                    newValue = value.Microinches;
-                    return true;
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-
-        /// <summary>
-        /// Try to dynamically convert from Mass to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvert(Mass value, Unit toUnit, out double newValue)
-        {
-            switch (toUnit)
-            {
-                case Unit.Megatonne:
-                    newValue = value.Megatonnes;
-                    return true;
-                case Unit.Kilotonne:
-                    newValue = value.Kilotonnes;
-                    return true;
-                case Unit.Tonne:
-                    newValue = value.Tonnes;
-                    return true;
-                case Unit.Kilogram:
-                    newValue = value.Kilograms;
-                    return true;
-                case Unit.Hectogram:
-                    newValue = value.Hectograms;
-                    return true;
-                case Unit.Decagram:
-                    newValue = value.Decagrams;
-                    return true;
-                case Unit.Gram:
-                    newValue = value.Grams;
-                    return true;
-                case Unit.Decigram:
-                    newValue = value.Decigrams;
-                    return true;
-                case Unit.Centigram:
-                    newValue = value.Centigrams;
-                    return true;
-                case Unit.Milligram:
-                    newValue = value.Milligrams;
-                    return true;
-                case Unit.ShortTon:
-                    newValue = value.ShortTons;
-                    return true;
-                case Unit.LongTon:
-                    newValue = value.LongTons;
-                    return true;
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-
-        /// <summary>
-        /// Try to dynamically convert from Pressure to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvert(Pressure value, Unit toUnit, out double newValue)
-        {
-            switch (toUnit)
-            {
-                case Unit.NewtonPerSquareMillimeter:
-                    newValue = value.NewtonsPerSquareMillimeter;
-                    return true;
-                case Unit.NewtonPerSquareCentimeter:
-                    newValue = value.NewtonsPerSquareCentimeter;
-                    return true;
-                case Unit.NewtonPerSquareMeter:
-                    newValue = value.NewtonsPerSquareMeter;
-                    return true;
-                case Unit.KilogramForcePerSquareCentimeter:
-                    newValue = value.KilogramForcePerSquareCentimeter;
-                    return true;
-                case Unit.Atmosphere:
-                    newValue = value.Atmospheres;
-                    return true;
-                case Unit.TechnicalAtmosphere:
-                    newValue = value.TechnicalAtmospheres;
-                    return true;
-                case Unit.Psi:
-                    newValue = value.Psi;
-                    return true;
-                case Unit.Torr:
-                    newValue = value.Torrs;
-                    return true;
-                case Unit.Bar:
-                    newValue = value.Bars;
-                    return true;
-                case Unit.Megapascal:
-                    newValue = value.Megapascals;
-                    return true;
-                case Unit.Kilopascal:
-                    newValue = value.Kilopascals;
-                    return true;
-                case Unit.Pascal:
-                    newValue = value.Pascals;
-                    return true;
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-
-        /// <summary>
-        /// Try to dynamically convert from RotationalSpeed to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvert(RotationalSpeed value, Unit toUnit, out double newValue)
-        {
-            switch (toUnit)
-            {
-                case Unit.RevolutionPerSecond:
-                    newValue = value.RevolutionsPerSecond;
-                    return true;
-                case Unit.RevolutionPerMinute:
-                    newValue = value.RevolutionsPerMinute;
-                    return true;
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-
-        /// <summary>
-        /// Try to dynamically convert from Torque to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvert(Torque value, Unit toUnit, out double newValue)
-        {
-            switch (toUnit)
-            {
-                case Unit.Newtonmeter:
-                    newValue = value.Newtonmeters;
-                    return true;
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-
-        /// <summary>
-        /// Try to dynamically convert from Volume to <paramref name="toUnit"/>.
-        /// </summary>
-        /// <param name="value">Value to convert from.</param>
-        /// <param name="toUnit">Compatible unit to convert to.</param>
-        /// <param name="newValue">Value in new unit if successful, zero otherwise.</param>
-        /// <returns>True if the two units were compatible and the conversion was successful.</returns>
-        private static bool TryConvert(Volume value, Unit toUnit, out double newValue)
-        {
-            switch (toUnit)
-            {
-                case Unit.CubicKilometer:
-                    newValue = value.CubicKilometers;
-                    return true;
-                case Unit.CubicMeter:
-                    newValue = value.CubicMeters;
-                    return true;
-                case Unit.CubicDecimeter:
-                    newValue = value.CubicDecimeters;
-                    return true;
-                case Unit.CubicCentimeter:
-                    newValue = value.CubicCentimeters;
-                    return true;
-                case Unit.CubicMillimeter:
-                    newValue = value.CubicMillimeters;
-                    return true;
-                case Unit.Hectoliter:
-                    newValue = value.Hectoliters;
-                    return true;
-                case Unit.Liter:
-                    newValue = value.Liters;
-                    return true;
-                case Unit.Deciliter:
-                    newValue = value.Deciliters;
-                    return true;
-                case Unit.Centiliter:
-                    newValue = value.Centiliters;
-                    return true;
-                case Unit.Milliliter:
-                    newValue = value.Milliliters;
-                    return true;
-                case Unit.CubicMile:
-                    newValue = value.CubicMiles;
-                    return true;
-                case Unit.CubicYard:
-                    newValue = value.CubicYards;
-                    return true;
-                case Unit.CubicFoot:
-                    newValue = value.CubicFeet;
-                    return true;
-                case Unit.CubicInch:
-                    newValue = value.CubicInches;
-                    return true;
-                case Unit.ImperialGallon:
-                    newValue = value.ImperialGallons;
-                    return true;
-                case Unit.UsGallon:
-                    newValue = value.UsGallons;
-                    return true;
-                case Unit.UsOunce:
-                    newValue = value.UsOunces;
-                    return true;
-                case Unit.ImperialOunce:
-                    newValue = value.ImperialOunces;
-                    return true;
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-
-        #endregion
-
-        #region Not implemented as unit class yet, no UnitAttribute for these
-
-        private static bool TryConvertTime(double value, Unit fromUnit, Unit toUnit, out double newValue)
-        {
-            switch (fromUnit)
-            {
-                case Unit.Year365Days:
-                    return TryConvert(TimeSpan.FromDays(365*value), toUnit, out newValue);
-                case Unit.Month30Days:
-                    return TryConvert(TimeSpan.FromDays(30*value), toUnit, out newValue);
-                case Unit.Week:
-                    return TryConvert(TimeSpan.FromDays(7*value), toUnit, out newValue);
-                case Unit.Day:
-                    return TryConvert(TimeSpan.FromDays(value), toUnit, out newValue);
-                case Unit.Hour:
-                    return TryConvert(TimeSpan.FromHours(value), toUnit, out newValue);
-                case Unit.Minute:
-                    return TryConvert(TimeSpan.FromMinutes(value), toUnit, out newValue);
-                case Unit.Second:
-                    return TryConvert(TimeSpan.FromSeconds(value), toUnit, out newValue);
-                case Unit.Millisecond:
-                    return TryConvert(TimeSpan.FromMilliseconds(value), toUnit, out newValue);
-                case Unit.Microsecond:
-                    return TryConvert(TimeSpan.FromTicks(System.Convert.ToInt64(value*10)), toUnit, out newValue);
-                case Unit.Nanosecond:
-                    return TryConvert(TimeSpan.FromSeconds(System.Convert.ToInt64(value/100)), toUnit, out newValue);
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-        private static bool TryConvert(TimeSpan t, Unit toUnit, out double newValue)
-        {
-            switch (toUnit)
-            {
-                case Unit.Year365Days:
-                    newValue = t.TotalDays/365;
-                    return true;
-                case Unit.Month30Days:
-                    newValue = t.TotalDays/30;
-                    return true;
-                case Unit.Week:
-                    newValue = t.TotalDays/7;
-                    return true;
-                case Unit.Day:
-                    newValue = t.TotalDays;
-                    return true;
-                case Unit.Hour:
-                    newValue = t.TotalHours;
-                    return true;
-                case Unit.Minute:
-                    newValue = t.TotalMinutes;
-                    return true;
-                case Unit.Second:
-                    newValue = t.TotalSeconds;
-                    return true;
-                case Unit.Millisecond:
-                    newValue = t.TotalMilliseconds;
-                    return true;
-                case Unit.Microsecond:
-                    newValue = t.Ticks/10.0;
-                    return true;
-                case Unit.Nanosecond:
-                    newValue = t.Ticks*100;
-                    return true;
-
-                default:
-                    newValue = 0;
-                    return false;
-            }
-        }
-
-        #endregion
-    }
-}
-


Eliminate two allocations in Crc32

Eliminate two allocations in Crc32

--- src/SharpCompress/Compressors/Deflate/CRC32.cs
+++ src/SharpCompress/Compressors/Deflate/CRC32.cs
@@ -189,7 +189,7 @@

         // pre-initialize the crc table for speed of lookup.

-        private uint gf2_matrix_times(uint[] matrix, uint vec)
+        private uint gf2_matrix_times(ReadOnlySpan<uint> matrix, uint vec)
         {
             uint sum = 0;
             int i = 0;
@@ -205,7 +205,7 @@
             return sum;
         }

-        private void gf2_matrix_square(uint[] square, uint[] mat)
+        private void gf2_matrix_square(Span<uint> square, Span<uint> mat)
         {
             for (int i = 0; i < 32; i++)
             {
@@ -225,8 +225,8 @@
         /// <param name="length">the length of data the CRC value was calculated on</param>
         public void Combine(int crc, int length)
         {
-            var even = new uint[32]; // even-power-of-two zeros operator
-            var odd = new uint[32]; // odd-power-of-two zeros operator
+            Span<uint> even = stackalloc uint[32]; // even-power-of-two zeros operator
+            Span<uint> odd = stackalloc uint[32]; // odd-power-of-two zeros operator

             if (length == 0)
             {


Added unit tests to improve the code coverage for the SqlLocalDbApi class.

--- src/SqlLocalDb.UnitTests/SqlLocalDbApiTests.cs
+++ src/SqlLocalDb.UnitTests/SqlLocalDbApiTests.cs
@@ -454,6 +454,43 @@
         }

         [TestMethod]
+        [Description("Tests DeleteUserInstances() does not throw an exception if an instance is in use.")]
+        public void SqlLocalDbApi_DeleteUserInstances_Does_Not_Throw_If_Instance_In_Use()
+        {
+            // Arrange
+            Helpers.EnsureLocalDBInstalled();
+
+            string instanceName = Guid.NewGuid().ToString();
+            bool deleteFiles = true;
+
+            SqlLocalDbApi.CreateInstance(instanceName);
+
+            try
+            {
+                SqlLocalDbApi.StartInstance(instanceName);
+
+                try
+                {
+                    // Act
+                    SqlLocalDbApi.DeleteUserInstances(deleteFiles);
+
+                    // Assert
+                    string instancePath = GetInstanceFolderPath(instanceName);
+                    Assert.IsTrue(Directory.Exists(instancePath), "The instance folder was deleted.");
+                    Assert.IsTrue(Directory.GetFiles(instancePath, "*.mdf").Length > 0, "The instance files were deleted.");
+                }
+                finally
+                {
+                    SqlLocalDbApi.StopInstance(instanceName);
+                }
+            }
+            finally
+            {
+                SqlLocalDbApi.DeleteInstance(instanceName, deleteFiles);
+            }
+        }
+
+        [TestMethod]
         [Description("Tests GetInstanceInfo() if instanceName is null.")]
         [ExpectedException(typeof(ArgumentNullException))]
         public void SqlLocalDbApi_GetInstanceInfo_Throws_If_InstanceName_Is_Null()
@@ -1296,6 +1333,43 @@
         }

         [TestMethod]
+        [Description("Tests DeleteInstanceFiles() does not throw an exception if an instance's files are in use.")]
+        public void SqlLocalDbApi_DeleteInstanceFiles_Does_Not_Throw_If_Instance_Files_In_Use()
+        {
+            // Arrange
+            Helpers.EnsureLocalDBInstalled();
+
+            string instanceName = Guid.NewGuid().ToString();
+            bool deleteFiles = true;
+
+            SqlLocalDbApi.CreateInstance(instanceName);
+
+            try
+            {
+                SqlLocalDbApi.StartInstance(instanceName);
+
+                try
+                {
+                    // Act
+                    SqlLocalDbApi.DeleteInstanceFiles(instanceName);
+
+                    // Assert
+                    string instancePath = GetInstanceFolderPath(instanceName);
+                    Assert.IsTrue(Directory.Exists(instancePath), "The instance folder was deleted.");
+                    Assert.IsTrue(Directory.GetFiles(instancePath, "*.mdf").Length > 0, "The instance files were deleted.");
+                }
+                finally
+                {
+                    SqlLocalDbApi.StopInstance(instanceName);
+                }
+            }
+            finally
+            {
+                SqlLocalDbApi.DeleteInstance(instanceName, deleteFiles);
+            }
+        }
+
+        [TestMethod]
         [Description("Tests that SqlLocalDbApi uses the correct default values if the configuration section is defined and the attributes are set.")]
         public void SqlLocalDbApi_Uses_User_Values_If_Configuration_Section_Defined_And_Attributes_Specified()
         {


Fixing bugs with 57 upgrade

Fixing bugs with 57 upgrade

--- SteamVR-WebKit/WebKitOverlay.cs
+++ SteamVR-WebKit/WebKitOverlay.cs
@@ -704,6 +704,10 @@

                 _parent.FocusedNodeChanged?.Invoke(browserControl, browser, frame, node);
             }
+
+            public void OnContextReleased(IWebBrowser browserControl, IBrowser browser, IFrame frame)
+            {
+            }
         }
     }
 }


Fixed a bug in SocialNetworkingWidget with handling of urls

--- en-US/Social/_SocialNetworkingWidget.cshtml
+++ en-US/Social/_SocialNetworkingWidget.cshtml
@@ -9,7 +9,7 @@
     if (Context.GetRouteValue("user").IsInt()) {
         photourl = LcUrl.LangUrl + "Profile/Photo/" + Context.GetRouteValue("user").AsInt();
     } else {
-        photourl.Replace("?UserID=", "Photo/");
+        photourl = url.Replace("?UserID=", "Photo/");
     }
     var iaux = photourl.IndexOf('#');
     if (iaux > -1) {


Added TDM support

Added TDM support

--- fCraft/Player/PlayerInfo.cs
+++ fCraft/Player/PlayerInfo.cs
@@ -1,4 +1,4 @@
-// Copyright 2009-2012 Matvei Stefarov <me@matvei.org>
+// Copyright 2009-2012 Matvei Stefarov <me@matvei.org>
 using System;
 using System.Collections.Generic;
 using System.Net;
@@ -13,29 +13,13 @@
     public sealed partial class PlayerInfo : IClassy {
         public const int MinFieldCount = 24;

-        //TeamDeathMatch
-        public bool isPlayingTD = false;
-        public bool isOnBlueTeam = false;
-        public bool isOnRedTeam = false;
-        public int totalKillsTDM = 0;
-        public int totalDeathsTDM = 0;
-        public int gameKills = 0;
-        public int gameDeaths = 0;
-
-        /// Number added onto number for mojang accounts. If 0, number will not be added on.
-        [NotNull]
-        public int mojang = 0;
-
-        /// Player's amount of bits for LegendCraft Economy.
+        /// Player's amount of bits.
         [CanBeNull]
         public int Money = 0;

         ///  Player's Minecraft account name.
         [NotNull]
-        public string Name
-        {
-            get; internal set;
-        }
+        public string Name { get; internal set; }

         ///  If set, replaces Name when printing name in chat.
         [CanBeNull]
@@ -79,11 +63,15 @@
         public bool ArrivedLate = false;
         public bool InGame = false;

-        //slap, kill, LeBot
+        //For CoolDown Timers
         public DateTime LastUsedSlap;
         public DateTime LastUsedKill;
         public DateTime LastUsedLeBot;
         public DateTime LastUsedInsult;
+        public DateTime LastUsedSwag;
+        public DateTime LastUsedDingusInfo;
+        public DateTime LastUsedHug;
+        public DateTime LastUsedBeatDown;
         public bool KillWait = false;

         //bromode
@@ -91,6 +79,16 @@
         public bool changedName = false;

         public bool HasVoted = false;
+
+        //TeamDeathMatch
+        public bool isPlayingTD = false;
+        public bool isOnBlueTeam = false;
+        public bool isOnRedTeam = false;
+        public int totalKillsTDM = 0;
+        public int totalDeathsTDM = 0;
+        public int gameKills = 0;
+        public int gameDeaths = 0;
+        public bool needsReversion = false;

         #region Rank
@@ -561,6 +559,12 @@
             }
             if( info.LastLoginDate < info.FirstLoginDate ) {
                 info.LastLoginDate = info.FirstLoginDate;
+            }
+
+            if (fields.Length > 48)
+            {
+                if (fields[48].Length > 0) Int32.TryParse(fields[48], out info.totalKillsTDM);
+                if (fields[49].Length > 0) Int32.TryParse(fields[49], out info.totalDeathsTDM);
             }

             return info;
@@ -1012,6 +1016,7 @@

             if( !LastFailedLoginIP.Equals( IPAddress.None ) ) sb.Append( LastFailedLoginIP.ToString() ); // 13
             sb.Append( ',' );
+
             if (Money > 0) sb.Digits(Money); // 14
             sb.Append(',');

@@ -1106,6 +1111,12 @@

             sb.Append( ',' );
             sb.AppendEscaped( DisplayedName ); // 47
+            sb.Append( ',' );
+
+            if (totalKillsTDM > 0) sb.Digits(totalKillsTDM); // 48
+            sb.Append(',');
+
+            if (totalDeathsTDM > 0) sb.Digits(totalDeathsTDM); // 49
         }

@@ -1198,6 +1209,10 @@
             writer.Write( LastIP.GetAddressBytes() ); // 41
             writer.Write( (byte)LeaveReason ); // 6
             writer.Write( (byte)BandwidthUseMode ); // 6
+
+            //TDM Stats
+            Write7BitEncodedInt(writer, totalKillsTDM); // 48
+            Write7BitEncodedInt(writer, totalDeathsTDM); // 49
         }

@@ -1267,6 +1282,16 @@
             PlayerObject = null;
             LeaveReason = player.LeaveReason;
             LastModified = DateTime.UtcNow;
+            //fix names if they leav during a TDM game
+            if (player.Info.isPlayingTD)
+            {
+                player.iName = null;
+                DisplayedName = oldname;
+                isOnRedTeam = false;
+                isOnBlueTeam = false;
+                isPlayingTD = false;
+                player.entityChanged = true;
+            }
         }


Updated the version in SolutionInfo.cs.  Forgot to do this.

--- SubtextSolution/SolutionInfo.cs
+++ SubtextSolution/SolutionInfo.cs
@@ -22,7 +22,7 @@
 /* [assembly: AssemblyVersion("1.0.4.0")] moved to VersionInfo.cs for automatic generation */
 /* Removed [AssemblyFileVersion] since it defaults to AssemblyVersion */
 /* Human Readable version. */
-[assembly: AssemblyInformationalVersion("1.5.0.0")]
+[assembly: AssemblyInformationalVersion("1.9.0.0")]

 //
 // In order to sign your assembly you must specify a key to use. Refer to the


Fixed accessibility of FindArrayType - now public. Needed by scipy.linalg.

--- numpy/NumpyDotNet/NpyArray.cs
+++ numpy/NumpyDotNet/NpyArray.cs
@@ -514,7 +514,7 @@
         /// <param name="minitype">Minimum type, or null if any</param>
         /// <param name="max">Maximum dimensions</param>
         /// <returns>Type descriptor fitting requirements</returns>
-        internal static dtype FindArrayType(Object src, dtype minitype, int max = NpyDefs.NPY_MAXDIMS) {
+        public static dtype FindArrayType(Object src, dtype minitype, int max = NpyDefs.NPY_MAXDIMS) {
             dtype chktype = null;

             if (src is ndarray) {


Assembly version bump.

Assembly version bump.

--- DevTrends.MvcDonutCaching/Properties/AssemblyInfo.cs
+++ DevTrends.MvcDonutCaching/Properties/AssemblyInfo.cs
@@ -2,14 +2,14 @@
 using System.Runtime.InteropServices;

 [assembly: AssemblyTitle("DevTrends.MvcDonutCaching")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
+// [assembly: AssemblyDescription("")]
+// [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("DevTrends")]
 [assembly: AssemblyProduct("DevTrends.MvcDonutCaching")]
-[assembly: AssemblyCopyright("Copyright © DevTrends 2012")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
+[assembly: AssemblyCopyright("Copyright © MvcDonutCaching contributors 2013")]
+// [assembly: AssemblyTrademark("")]
+// [assembly: AssemblyCulture("")]
 [assembly: ComVisible(false)]
 [assembly: Guid("ebcc3291-f04a-4511-b7eb-ddf57a74ada9")]
-[assembly: AssemblyVersion("1.2.1")]
-[assembly: AssemblyFileVersion("1.2.1")]
+[assembly: AssemblyVersion("1.2.2")]
+[assembly: AssemblyFileVersion("1.2.2")]


Better yet, make it readonly and just modify it on passing through context

--- CertiPay.Common/Logging/SerilogManager.cs
+++ CertiPay.Common/Logging/SerilogManager.cs
@@ -57,11 +57,16 @@
                         .CreateLogger();
         });

-        private ILogger _logger;
+        private readonly ILogger _logger;

         internal SerilogManager(String key)
         {
             _logger = logger.Value.ForContext("Logger", key);
+        }
+
+        internal SerilogManager(ILogger logger)
+        {
+            _logger = logger;
         }

         public void Log(LogLevel level, string messageTemplate, params object[] propertyValues)
@@ -77,8 +82,7 @@
         public ILog WithContext(string propertyName, object value, Boolean destructureObjects = false)
         {
             // Add the context into the _logger and pass back the ILog interface
-            _logger = _logger.ForContext(propertyName, value, destructureObjects);
-            return this;
+            return new SerilogManager(_logger.ForContext(propertyName, value, destructureObjects));
         }

         internal static LogEventLevel GetLevel(LogLevel level)


Fixed CopyFromNode.

Fixed CopyFromNode.

--- Nodes/BitFieldNode.cs
+++ Nodes/BitFieldNode.cs
@@ -51,6 +51,8 @@
 		public override void CopyFromNode(BaseNode node)
 		{
 			Contract.Requires(node != null);
+
+			base.CopyFromNode(node);

 			Bits = node.MemorySize * 8;
 		}


Update SiteBuilderFactory.cs

Update SiteBuilderFactory.cs

Check for ASP.NET 5 before WebSiteProject

--- Kudu.Core/Deployment/Generator/SiteBuilderFactory.cs
+++ Kudu.Core/Deployment/Generator/SiteBuilderFactory.cs
@@ -194,6 +194,17 @@
             {
                 return DetermineProject(repositoryRoot, projects[0], perDeploymentSettings, fileFinder);
             }
+
+            // Check for ASP.NET 5 project without VS solution or project
+            string projectJson;
+            if (AspNet5Helper.TryAspNet5Project(targetPath, out projectJson))
+            {
+                return new AspNet5Builder(_environment,
+                                           perDeploymentSettings,
+                                           _propertyProvider,
+                                           repositoryRoot,
+                                           projectJson);
+            }

             if (tryWebSiteProject)
             {
@@ -225,17 +236,6 @@
                 throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture,
                                                                   Resources.Error_ProjectDoesNotExist,
                                                                   targetPath));
-            }
-
-            // Check for ASP.NET 5 project without VS solution or project
-            string projectJson;
-            if (AspNet5Helper.TryAspNet5Project(targetPath, out projectJson))
-            {
-                return new AspNet5Builder(_environment,
-                                           perDeploymentSettings,
-                                           _propertyProvider,
-                                           repositoryRoot,
-                                           projectJson);
             }

             // If there's none then use the basic builder (the site is xcopy deployable)


An attempt to fix the write error when running on the builder

#44

--- LINQToTTree/LINQToTreeHelpers.Tests/t_FutureTFile.cs
+++ LINQToTTree/LINQToTreeHelpers.Tests/t_FutureTFile.cs
@@ -56,6 +56,10 @@
             {
                 f.Delete();
             }
+            while (f.Exists)
+            {
+                f.Refresh();
+            }

             using (var ftf = new FutureTFile(f))
             {


normalized whitespaces

normalized whitespaces

--- ClientDecisionServiceTest/UploaderTest.cs
+++ ClientDecisionServiceTest/UploaderTest.cs
@@ -1,46 +1,46 @@
-using System;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using ClientDecisionService;
-using MultiWorldTesting;
-using System.Net;
-using System.Threading.Tasks;
-using System.Threading;
-using System.IO;
-using System.Linq;
-using System.Text;
-using Microsoft.Research.DecisionService.Common;
-using Newtonsoft.Json;
-using System.Web;
-using Microsoft.Research.DecisionService.Uploader;
-using Microsoft.WindowsAzure.Storage;
-using Microsoft.WindowsAzure.Storage.Blob;
-using System.Collections.Generic;
-
-namespace ClientDecisionServiceTest
-{
-    [TestClass]
-    public class UploaderTest
-    {
-        [TestMethod]
-        public void TestUploaderSingleEvent()
-        {
-            joinServer.Reset();
-
-            string uniqueKey = "test interaction";
-            int eventSentCount = 0;
-
-            var uploader = new EventUploader(null, MockJoinServer.MockJoinServerAddress);
-            uploader.InitializeWithToken(MockCommandCenter.AuthorizationToken);
-            uploader.PackageSent += (sender, e) => { eventSentCount += e.Records.Count(); };
-            uploader.Upload(new MultiActionInteraction { Actions = new uint[] { 1 }, Context = JsonConvert.SerializeObject(new TestContext()), Probability = 0.5, Key = uniqueKey });
-            uploader.Flush();
-
-            Assert.AreEqual(1, eventSentCount);
-            Assert.AreEqual(1, joinServer.RequestCount);
-            Assert.AreEqual(1, joinServer.EventBatchList.Count);
-            Assert.AreEqual(1, joinServer.EventBatchList[0].ExperimentalUnitFragments.Count);
-            Assert.AreEqual(uniqueKey, joinServer.EventBatchList[0].ExperimentalUnitFragments[0].Id);
-            Assert.IsTrue(joinServer.EventBatchList[0].ExperimentalUnitFragments[0].Value.ToLower().Contains("\"a\":[1],"));
+using System;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using ClientDecisionService;
+using MultiWorldTesting;
+using System.Net;
+using System.Threading.Tasks;
+using System.Threading;
+using System.IO;
+using System.Linq;
+using System.Text;
+using Microsoft.Research.DecisionService.Common;
+using Newtonsoft.Json;
+using System.Web;
+using Microsoft.Research.DecisionService.Uploader;
+using Microsoft.WindowsAzure.Storage;
+using Microsoft.WindowsAzure.Storage.Blob;
+using System.Collections.Generic;
+
+namespace ClientDecisionServiceTest
+{
+    [TestClass]
+    public class UploaderTest
+    {
+        [TestMethod]
+        public void TestUploaderSingleEvent()
+        {
+            joinServer.Reset();
+
+            string uniqueKey = "test interaction";
+            int eventSentCount = 0;
+
+            var uploader = new EventUploader(null, MockJoinServer.MockJoinServerAddress);
+            uploader.InitializeWithToken(MockCommandCenter.AuthorizationToken);
+            uploader.PackageSent += (sender, e) => { eventSentCount += e.Records.Count(); };
+            uploader.Upload(new MultiActionInteraction { Actions = new uint[] { 1 }, Context = JsonConvert.SerializeObject(new TestContext()), Probability = 0.5, Key = uniqueKey });
+            uploader.Flush();
+
+            Assert.AreEqual(1, eventSentCount);
+            Assert.AreEqual(1, joinServer.RequestCount);
+            Assert.AreEqual(1, joinServer.EventBatchList.Count);
+            Assert.AreEqual(1, joinServer.EventBatchList[0].ExperimentalUnitFragments.Count);
+            Assert.AreEqual(uniqueKey, joinServer.EventBatchList[0].ExperimentalUnitFragments[0].Id);
+            Assert.IsTrue(joinServer.EventBatchList[0].ExperimentalUnitFragments[0].Value.ToLower().Contains("\"a\":[1],"));
         }

         [TestMethod]
@@ -134,13 +134,13 @@
             }

             Assert.AreEqual(true, exceptionCaught);
-        }
-
-        [TestMethod]
-        public void TestUploaderMultipleEvents()
-        {
-            joinServer.Reset();
-
+        }
+
+        [TestMethod]
+        public void TestUploaderMultipleEvents()
+        {
+            joinServer.Reset();
+
             string uniqueKey = "test interaction";
             int eventSentCount = 0;

@@ -150,80 +150,80 @@

             uploader.Upload(new MultiActionInteraction { Actions = new uint[] { 1 }, Context = JsonConvert.SerializeObject(new TestContext()), Probability = 0.5, Key = uniqueKey });
             uploader.Upload(new MultiActionInteraction { Actions = new uint[] { 2 }, Context = JsonConvert.SerializeObject(new TestContext()), Probability = 0.7, Key = uniqueKey });
-            uploader.Upload(new MultiActionInteraction { Actions = new uint[] { 0 }, Context = JsonConvert.SerializeObject(new TestContext()), Probability = 0.5, Key = uniqueKey });
-
-            uploader.Upload(new Observation { Value = "1", Key = uniqueKey });
-            uploader.Upload(new Observation { Value = "2", Key = uniqueKey });
-            uploader.Upload(new Observation { Value = JsonConvert.SerializeObject(new { value = "test outcome" }), Key = uniqueKey });
-
-            uploader.Flush();
-
-            Assert.AreEqual(6, eventSentCount);
-            Assert.AreEqual(6, joinServer.EventBatchList.Sum(batch => batch.ExperimentalUnitFragments.Count));
-        }
-
-        [TestMethod]
-        public void TestUploaderThreadSafeMock()
-        {
-            joinServer.Reset();
-
-            string uniqueKey = "test interaction";
-            int eventSentCount = 0;
-
-            var uploader = new EventUploader(null, MockJoinServer.MockJoinServerAddress);
-            uploader.InitializeWithToken(MockCommandCenter.AuthorizationToken);
-            uploader.PackageSent += (sender, e) => { Interlocked.Add(ref eventSentCount, e.Records.Count()); };
-
-            int numEvents = 1000;
-            Parallel.For(0, numEvents, new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount * 2 }, (i) =>
-            {
-                uploader.Upload(new MultiActionInteraction { Actions = new uint[] { (uint)i }, Context = JsonConvert.SerializeObject(new TestContext()), Probability = i / 1000.0, Key = uniqueKey });
-                uploader.Upload(new Observation { Value = JsonConvert.SerializeObject(new { value = "999" + i }), Key = uniqueKey });
-            });
-            uploader.Flush();
-
-            Assert.AreEqual(numEvents * 2, eventSentCount);
-            Assert.AreEqual(numEvents * 2, joinServer.EventBatchList.Sum(batch => batch.ExperimentalUnitFragments.Count));
-        }
-
-        /**** REQUIRES LOCAL DEPLOYMENT OF JOIN SERVER ****/
-        [TestMethod]
-        public void TestUploaderThreadSafeLocal()
-        {
+            uploader.Upload(new MultiActionInteraction { Actions = new uint[] { 0 }, Context = JsonConvert.SerializeObject(new TestContext()), Probability = 0.5, Key = uniqueKey });
+
+            uploader.Upload(new Observation { Value = "1", Key = uniqueKey });
+            uploader.Upload(new Observation { Value = "2", Key = uniqueKey });
+            uploader.Upload(new Observation { Value = JsonConvert.SerializeObject(new { value = "test outcome" }), Key = uniqueKey });
+
+            uploader.Flush();
+
+            Assert.AreEqual(6, eventSentCount);
+            Assert.AreEqual(6, joinServer.EventBatchList.Sum(batch => batch.ExperimentalUnitFragments.Count));
+        }
+
+        [TestMethod]
+        public void TestUploaderThreadSafeMock()
+        {
+            joinServer.Reset();
+
+            string uniqueKey = "test interaction";
+            int eventSentCount = 0;
+
+            var uploader = new EventUploader(null, MockJoinServer.MockJoinServerAddress);
+            uploader.InitializeWithToken(MockCommandCenter.AuthorizationToken);
+            uploader.PackageSent += (sender, e) => { Interlocked.Add(ref eventSentCount, e.Records.Count()); };
+
+            int numEvents = 1000;
+            Parallel.For(0, numEvents, new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount * 2 }, (i) =>
+            {
+                uploader.Upload(new MultiActionInteraction { Actions = new uint[] { (uint)i }, Context = JsonConvert.SerializeObject(new TestContext()), Probability = i / 1000.0, Key = uniqueKey });
+                uploader.Upload(new Observation { Value = JsonConvert.SerializeObject(new { value = "999" + i }), Key = uniqueKey });
+            });
+            uploader.Flush();
+
+            Assert.AreEqual(numEvents * 2, eventSentCount);
+            Assert.AreEqual(numEvents * 2, joinServer.EventBatchList.Sum(batch => batch.ExperimentalUnitFragments.Count));
+        }
+
+        /**** REQUIRES LOCAL DEPLOYMENT OF JOIN SERVER ****/
+        [TestMethod]
+        public void TestUploaderThreadSafeLocal()
+        {
             string uniqueKey = "test interaction";

             var createAction = (Func<int, int>)((i) => { return i; });
             var createObservation = (Func<int, string>)((i) => { return string.Format("00000", i); });
             var createProbability = (Func<int, float>)((i) => { return i / 1000.0f; });

-            var uploader = new EventUploader(null, MockJoinServer.LocalJoinServerAddress);
-            int experimentalUnitDuration = 5;
-            uploader.InitializeWithConnectionString(MockCommandCenter.StorageConnectionString, experimentalUnitDuration);
-
-            int numEvents = 1000;
-            Parallel.For(0, numEvents, new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount * 2 }, (i) =>
+            var uploader = new EventUploader(null, MockJoinServer.LocalJoinServerAddress);
+            int experimentalUnitDuration = 5;
+            uploader.InitializeWithConnectionString(MockCommandCenter.StorageConnectionString, experimentalUnitDuration);
+
+            int numEvents = 1000;
+            Parallel.For(0, numEvents, new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount * 2 }, (i) =>
             {
                 uploader.Upload(new MultiActionInteraction { Actions = new uint[] { (uint)createAction(i) }, Context = JsonConvert.SerializeObject(new TestContext()), Probability = createProbability(i), Key = uniqueKey });
-                uploader.Upload(new Observation { Value = JsonConvert.SerializeObject(new { value = createObservation(i) }), Key = uniqueKey });
-            });
+                uploader.Upload(new Observation { Value = JsonConvert.SerializeObject(new { value = createObservation(i) }), Key = uniqueKey });
+            });
             uploader.Flush();

             // Allow join server time to push data to blob
-            System.Threading.Thread.Sleep(experimentalUnitDuration * 2000);
-
-            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(MockCommandCenter.StorageConnectionString);
-            CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
+            System.Threading.Thread.Sleep(experimentalUnitDuration * 2000);
+
+            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(MockCommandCenter.StorageConnectionString);
+            CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
             IEnumerable<CloudBlobContainer> completeContainers = blobClient.ListContainers("complete");

-            bool foundBlobData = false;
-            foreach (CloudBlobContainer container in completeContainers)
-            {
-                var blobs = container.ListBlobs();
-
-                foreach (var b in blobs)
-                {
-                    CloudBlockBlob bb = b as CloudBlockBlob;
-                    string content = bb.DownloadText();
+            bool foundBlobData = false;
+            foreach (CloudBlobContainer container in completeContainers)
+            {
+                var blobs = container.ListBlobs();
+
+                foreach (var b in blobs)
+                {
+                    CloudBlockBlob bb = b as CloudBlockBlob;
+                    string content = bb.DownloadText();
                     var completeBlobData = JsonConvert.DeserializeObject<CompleteDecisionServiceBlob>(content);

                     Assert.AreEqual(1, completeBlobData.Data.Count);
@@ -256,28 +256,28 @@
                     foundBlobData = true;

                     return;
-                }
+                }
             }

-            Assert.AreEqual(true, foundBlobData);
-        }
-
-        [TestInitialize]
-        public void Setup()
-        {
-            joinServer = new MockJoinServer(MockJoinServer.MockJoinServerAddress);
-
+            Assert.AreEqual(true, foundBlobData);
+        }
+
+        [TestInitialize]
+        public void Setup()
+        {
+            joinServer = new MockJoinServer(MockJoinServer.MockJoinServerAddress);
+
             joinServer.Run();

-            AzureStorageHelper.CleanCompleteBlobs();
-        }
-
-        [TestCleanup]
-        public void CleanUp()
-        {
-            joinServer.Stop();
-        }
-
-        private MockJoinServer joinServer;
-    }
-}
+            AzureStorageHelper.CleanCompleteBlobs();
+        }
+
+        [TestCleanup]
+        public void CleanUp()
+        {
+            joinServer.Stop();
+        }
+
+        private MockJoinServer joinServer;
+    }
+}


Solve most of the failed test

Solve most of the failed test

--- Cogs.Publishers/JsonReuseableConverter.cs
+++ Cogs.Publishers/JsonReuseableConverter.cs
@@ -29,10 +29,6 @@
                         obj.Add(new JProperty("Reference",
                            new JObject(new JProperty("type", "object"),
                            new JProperty("properties", new JObject(new JProperty("$type", new JObject(new JProperty("type", "string"))), new JProperty("value", new JObject(new JProperty("type", "array"), new JProperty("items", new JObject(new JProperty("type", "string"))))))))));
-                        if(!reuse.AddProp)
-                        {
-                            obj.Add(new JProperty("additionalProperties", false));
-                        }
                     }
                     else
                     {


added some more values

added some more values

--- ColorManagerTests/ICC/Data/StructsData.cs
+++ ColorManagerTests/ICC/Data/StructsData.cs
@@ -108,13 +108,17 @@
         public static readonly XYZNumber XYZNumber_ValMin = new XYZNumber(PrimitivesData.Fix16_ValMin, PrimitivesData.Fix16_ValMin, PrimitivesData.Fix16_ValMin);
         public static readonly XYZNumber XYZNumber_Val0 = new XYZNumber(0, 0, 0);
         public static readonly XYZNumber XYZNumber_Val1 = new XYZNumber(1, 1, 1);
-        public static readonly XYZNumber XYZNumber_ValVar = new XYZNumber(PrimitivesData.Fix16_ValMin, 1, PrimitivesData.Fix16_ValMax);
+        public static readonly XYZNumber XYZNumber_ValVar1 = new XYZNumber(1, 2, 3);
+        public static readonly XYZNumber XYZNumber_ValVar2 = new XYZNumber(4, 5, 6);
+        public static readonly XYZNumber XYZNumber_ValVar3 = new XYZNumber(7, 8, 9);
         public static readonly XYZNumber XYZNumber_ValMax = new XYZNumber(PrimitivesData.Fix16_ValMax, PrimitivesData.Fix16_ValMax, PrimitivesData.Fix16_ValMax);

         public static readonly byte[] XYZNumber_Min = ArrayHelper.Concat(PrimitivesData.Fix16_Min, PrimitivesData.Fix16_Min, PrimitivesData.Fix16_Min);
         public static readonly byte[] XYZNumber_0 = ArrayHelper.Concat(PrimitivesData.Fix16_0, PrimitivesData.Fix16_0, PrimitivesData.Fix16_0);
         public static readonly byte[] XYZNumber_1 = ArrayHelper.Concat(PrimitivesData.Fix16_1, PrimitivesData.Fix16_1, PrimitivesData.Fix16_1);
-        public static readonly byte[] XYZNumber_Var = ArrayHelper.Concat(PrimitivesData.Fix16_Min, PrimitivesData.Fix16_1, PrimitivesData.Fix16_Max);
+        public static readonly byte[] XYZNumber_Var1 = ArrayHelper.Concat(PrimitivesData.Fix16_1, PrimitivesData.Fix16_2, PrimitivesData.Fix16_3);
+        public static readonly byte[] XYZNumber_Var2 = ArrayHelper.Concat(PrimitivesData.Fix16_4, PrimitivesData.Fix16_5, PrimitivesData.Fix16_6);
+        public static readonly byte[] XYZNumber_Var3 = ArrayHelper.Concat(PrimitivesData.Fix16_7, PrimitivesData.Fix16_8, PrimitivesData.Fix16_9);
         public static readonly byte[] XYZNumber_Max = ArrayHelper.Concat(PrimitivesData.Fix16_Max, PrimitivesData.Fix16_Max, PrimitivesData.Fix16_Max);

         #endregion
@@ -147,10 +151,26 @@

         public static readonly ResponseNumber ResponseNumber_ValMin = new ResponseNumber(0, PrimitivesData.Fix16_ValMin);
         public static readonly ResponseNumber ResponseNumber_Val1 = new ResponseNumber(1, 1);
+        public static readonly ResponseNumber ResponseNumber_Val2 = new ResponseNumber(2, 2);
+        public static readonly ResponseNumber ResponseNumber_Val3 = new ResponseNumber(3, 3);
+        public static readonly ResponseNumber ResponseNumber_Val4 = new ResponseNumber(4, 4);
+        public static readonly ResponseNumber ResponseNumber_Val5 = new ResponseNumber(5, 5);
+        public static readonly ResponseNumber ResponseNumber_Val6 = new ResponseNumber(6, 6);
+        public static readonly ResponseNumber ResponseNumber_Val7 = new ResponseNumber(7, 7);
+        public static readonly ResponseNumber ResponseNumber_Val8 = new ResponseNumber(8, 8);
+        public static readonly ResponseNumber ResponseNumber_Val9 = new ResponseNumber(9, 9);
         public static readonly ResponseNumber ResponseNumber_ValMax = new ResponseNumber(ushort.MaxValue, PrimitivesData.Fix16_ValMax);

         public static readonly byte[] ResponseNumber_Min = ArrayHelper.Concat(PrimitivesData.UInt16_0, PrimitivesData.Fix16_Min);
         public static readonly byte[] ResponseNumber_1 = ArrayHelper.Concat(PrimitivesData.UInt16_1, PrimitivesData.Fix16_1);
+        public static readonly byte[] ResponseNumber_2 = ArrayHelper.Concat(PrimitivesData.UInt16_2, PrimitivesData.Fix16_2);
+        public static readonly byte[] ResponseNumber_3 = ArrayHelper.Concat(PrimitivesData.UInt16_3, PrimitivesData.Fix16_3);
+        public static readonly byte[] ResponseNumber_4 = ArrayHelper.Concat(PrimitivesData.UInt16_4, PrimitivesData.Fix16_4);
+        public static readonly byte[] ResponseNumber_5 = ArrayHelper.Concat(PrimitivesData.UInt16_5, PrimitivesData.Fix16_5);
+        public static readonly byte[] ResponseNumber_6 = ArrayHelper.Concat(PrimitivesData.UInt16_6, PrimitivesData.Fix16_6);
+        public static readonly byte[] ResponseNumber_7 = ArrayHelper.Concat(PrimitivesData.UInt16_7, PrimitivesData.Fix16_7);
+        public static readonly byte[] ResponseNumber_8 = ArrayHelper.Concat(PrimitivesData.UInt16_8, PrimitivesData.Fix16_8);
+        public static readonly byte[] ResponseNumber_9 = ArrayHelper.Concat(PrimitivesData.UInt16_9, PrimitivesData.Fix16_9);
         public static readonly byte[] ResponseNumber_Max = ArrayHelper.Concat(PrimitivesData.UInt16_Max, PrimitivesData.Fix16_Max);

         #endregion


Added tests for PackageFactory.GetPackage

--- OpenIIoT.Core.Tests/Packaging/PackageFactoryTests.cs
+++ OpenIIoT.Core.Tests/Packaging/PackageFactoryTests.cs
@@ -50,8 +50,14 @@

 namespace OpenIIoT.Core.Tests.Packaging
 {
+    using System;
+    using System.IO;
     using Moq;
+    using Newtonsoft.Json;
     using OpenIIoT.Core.Packaging;
+    using OpenIIoT.SDK.Common.OperationResult;
+    using OpenIIoT.SDK.Packaging;
+    using OpenIIoT.SDK.Packaging.Manifest;
     using OpenIIoT.SDK.Packaging.Operations;
     using OpenIIoT.SDK.Platform;
     using Xunit;
@@ -59,7 +65,7 @@
     /// <summary>
     ///     Unit tests for the <see cref="PackageFactory"/> class.
     /// </summary>
-    public class PackageFactoryTests
+    public class PackageFactoryTests : IDisposable
     {
         #region Public Constructors

@@ -68,9 +74,17 @@
         /// </summary>
         public PackageFactoryTests()
         {
+            TempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
+            Directory.CreateDirectory(TempDirectory);
+
+            PackageManifest = new PackageManifestBuilder().BuildDefault().Manifest;
+
             ManifestExtractorMock = new Mock<IManifestExtractor>();
             PackageVerifierMock = new Mock<IPackageVerifier>();
+            PlatformMock = new Mock<IPlatform>();
             PlatformManagerMock = new Mock<IPlatformManager>();
+            PackageMock = new Mock<IPackage>();
+            PackageArchiveMock = new Mock<IPackageArchive>();

             SetupMocks();
         }
@@ -85,17 +99,118 @@
         private Mock<IManifestExtractor> ManifestExtractorMock { get; set; }

         /// <summary>
+        ///     Gets or sets the IPackageArchive mockup.
+        /// </summary>
+        private Mock<IPackageArchive> PackageArchiveMock { get; set; }
+
+        /// <summary>
+        ///     Gets or sets the IPackageManifest instance.
+        /// </summary>
+        private IPackageManifest PackageManifest { get; set; }
+
+        /// <summary>
+        ///     Gets or sets the IPackage mockup.
+        /// </summary>
+        private Mock<IPackage> PackageMock { get; set; }
+
+        /// <summary>
         ///     Gets or sets the IPackageVerifier mockup.
         /// </summary>
         private Mock<IPackageVerifier> PackageVerifierMock { get; set; }

         /// <summary>
-        ///     Gets or sets IPlatformManager mockup.
+        ///     Gets or sets the IPlatformManager mockup.
         /// </summary>
         private Mock<IPlatformManager> PlatformManagerMock { get; set; }

+        /// <summary>
+        ///     Gets or sets the IPlatform mockup.
+        /// </summary>
+        private Mock<IPlatform> PlatformMock { get; set; }
+
+        /// <summary>
+        ///     Gets or sets the temporary directory.
+        /// </summary>
+        private string TempDirectory { get; set; }
+
         #endregion Private Properties

+        #region Public Methods
+
+        /// <summary>
+        ///     Tests the constructor and all properties.
+        /// </summary>
+        [Fact]
+        public void Constructor()
+        {
+            PackageFactory test;
+
+            Exception ex = Record.Exception(() => test = new PackageFactory(PlatformManagerMock.Object, ManifestExtractorMock.Object, PackageVerifierMock.Object));
+
+            Assert.Null(ex);
+        }
+
+        /// <summary>
+        ///     Disposes this instance.
+        /// </summary>
+        public void Dispose()
+        {
+            Directory.Delete(TempDirectory, true);
+        }
+
+        /// <summary>
+        ///     Tests the <see cref="PackageFactory.GetPackage(string)"/> method.
+        /// </summary>
+        [Fact]
+        public void GetPackage()
+        {
+            PackageFactory test = new PackageFactory(PlatformManagerMock.Object, ManifestExtractorMock.Object, PackageVerifierMock.Object);
+
+            IResult<IPackage> result = test.GetPackage(TempDirectory);
+
+            string fqn = PackageManifest.Namespace + "." + PackageManifest.Name;
+
+            Assert.Equal(ResultCode.Success, result.ResultCode);
+            Assert.Equal(TempDirectory, result.ReturnValue.DirectoryName);
+            Assert.Equal(fqn, result.ReturnValue.FQN);
+            Assert.Equal(PackageManifest.Name, result.ReturnValue.Manifest.Name);
+            Assert.Equal(PackageManifest.Namespace, result.ReturnValue.Manifest.Namespace);
+        }
+
+        /// <summary>
+        ///     Tests the <see cref="PackageFactory.GetPackage(string)"/> method with a known bad .manifest.json file.
+        /// </summary>
+        [Fact]
+        public void GetPackageBadManifest()
+        {
+            PlatformMock.Setup(p => p.ReadFileText(It.IsAny<string>()))
+                .Returns(new Result<string>().SetReturnValue("{"));
+
+            PackageFactory test = new PackageFactory(PlatformManagerMock.Object, ManifestExtractorMock.Object, PackageVerifierMock.Object);
+
+            IResult<IPackage> result = test.GetPackage(TempDirectory);
+
+            Assert.Equal(ResultCode.Failure, result.ResultCode);
+        }
+
+        /// <summary>
+        ///     Tests the <see cref="PackageFactory.GetPackage(string)"/> method with a failing file read.
+        /// </summary>
+        [Fact]
+        public void GetPackageFailedManifestRead()
+        {
+            PlatformMock.Setup(p => p.ReadFileText(It.IsAny<string>()))
+                .Returns(new Result<string>(ResultCode.Failure));
+
+            PackageFactory test = new PackageFactory(PlatformManagerMock.Object, ManifestExtractorMock.Object, PackageVerifierMock.Object);
+
+            IResult<IPackage> result = test.GetPackage(TempDirectory);
+
+            Assert.Equal(ResultCode.Failure, result.ResultCode);
+        }
+
+        #endregion Public Methods
+
         #region Private Methods

         /// <summary>
@@ -103,6 +218,14 @@
         /// </summary>
         private void SetupMocks()
         {
+            string manifestString = JsonConvert.SerializeObject(PackageManifest);
+
+            PlatformMock.Setup(p => p.ReadFileText(It.IsAny<string>()))
+                .Returns(new Result<string>().SetReturnValue(manifestString));
+
+            PlatformManagerMock.Setup(p => p.Platform).Returns(PlatformMock.Object);
+
+            PackageMock.Setup(p => p.Manifest).Returns(PackageManifest);
         }

         #endregion Private Methods


Add missing attribute to mouse wave effect

Added the missing UsedImplicitly attribute to mouse's Wave effect.

--- Corale.Colore/Razer/Mouse/Effects/Wave.cs
+++ Corale.Colore/Razer/Mouse/Effects/Wave.cs
@@ -30,6 +30,8 @@

 namespace Corale.Colore.Razer.Mouse.Effects
 {
+    using Corale.Colore.Annotations;
+
     /// <summary>
     /// Wave effect.
     /// </summary>
@@ -38,6 +40,7 @@
         /// <summary>
         /// The direction of the wave effect.
         /// </summary>
+        [UsedImplicitly]
         public Direction Direction;

         /// <summary>


fix .net core compatibility

fix .net core compatibility

--- Serenity.Data.Entity/Row/OriginPropertyDictionary.cs
+++ Serenity.Data.Entity/Row/OriginPropertyDictionary.cs
@@ -15,7 +15,7 @@
         internal Dictionary<string, Tuple<string, ForeignKeyAttribute, ISqlJoin>> joinPropertyByAlias;
         internal Dictionary<string, ISqlJoin> rowJoinByAlias;
         internal Dictionary<string, OriginAttribute> origins;
-        internal Dictionary<string, PropertyInfo> originPropertyByName;
+        internal Dictionary<string, Tuple<PropertyInfo, Type>> originPropertyByName;
         internal ILookup<string, KeyValuePair<string, OriginAttribute>> originByAlias;
         internal IDictionary<string, string> prefixByAlias;

@@ -112,33 +112,35 @@
             return dictionary;
         }

-        private PropertyInfo GetOriginProperty(string name)
-        {
-            PropertyInfo pi;
-
+        private Tuple<PropertyInfo, Type> GetOriginProperty(string name)
+        {
+            Type originType;
+            Tuple<PropertyInfo, Type> pi;
             var d = originPropertyByName;
             if (d == null)
             {
-                d = new Dictionary<string, PropertyInfo>();
-                d[name] = pi = GetOriginProperty(propertyByName[name], origins[name]);
+                d = new Dictionary<string, Tuple<PropertyInfo, Type>>();
+                d[name] = pi = new Tuple<PropertyInfo, Type>(GetOriginProperty(propertyByName[name],
+                    origins[name], out originType), originType);
                 originPropertyByName = d;
             }
             else if (!d.TryGetValue(name, out pi))
             {
-                d = new Dictionary<string, PropertyInfo>(d);
-                d[name] = pi = GetOriginProperty(propertyByName[name], origins[name]);
+                d = new Dictionary<string, Tuple<PropertyInfo, Type>>();
+                d[name] = pi = new Tuple<PropertyInfo, Type>(GetOriginProperty(propertyByName[name],
+                    origins[name], out originType), originType);
                 originPropertyByName = d;
             }

             return pi;
         }

-        private PropertyInfo GetOriginProperty(PropertyInfo property, OriginAttribute origin)
+        private PropertyInfo GetOriginProperty(PropertyInfo property, OriginAttribute origin,
+            out Type originRowType)
         {
             var joinAlias = origin.Join;
             Tuple<string, ForeignKeyAttribute, ISqlJoin> joinProperty;

-            Type originRowType;
             ISqlJoin rowJoin;
             if (joinPropertyByAlias.TryGetValue(joinAlias, out joinProperty))
             {
@@ -215,7 +217,8 @@
             if (aliasPrefix.Length >= 1000)
                 throw new DivideByZeroException("Infinite origin recursion detected!");

-            var originProperty = GetOriginProperty(property.Name);
+            var org = GetOriginProperty(property.Name);
+            var originProperty = org.Item1;

             if (aliasPrefix.Length == 0)
                 aliasPrefix = origin.Join;
@@ -227,7 +230,7 @@
                 return aliasPrefix + "." + SqlSyntax.AutoBracket(columnAttr.Name);
             else
             {
-                var originDictionary = GetPropertyDictionary(originProperty.ReflectedType);
+                var originDictionary = GetPropertyDictionary(org.Item2);

                 var expressionAttr = originProperty.GetCustomAttributes<ExpressionAttribute>();
                 if (expressionAttr.Any())
@@ -256,7 +259,9 @@
             if (recursion++ > 1000)
                 throw new DivideByZeroException("Infinite origin recursion detected!");

-            var originProperty = GetOriginProperty(property.Name);
+            var org = GetOriginProperty(property.Name);
+            var originProperty = org.Item1;
+
             var attr = originProperty.GetCustomAttribute(typeof(TAttr));
             if (attr != null)
                 return (TAttr)attr;
@@ -264,7 +269,7 @@
             var originOrigin = originProperty.GetCustomAttribute<OriginAttribute>();
             if (originOrigin != null)
             {
-                var originDictionary = GetPropertyDictionary(originProperty.ReflectedType);
+                var originDictionary = GetPropertyDictionary(org.Item2);
                 return originDictionary.OriginAttribute<TAttr>(originProperty, originOrigin);
             }

@@ -308,7 +313,8 @@
                 return prefix + " " + s;
             };

-            var originProperty = GetOriginProperty(property.Name);
+            var org = GetOriginProperty(property.Name);
+            var originProperty = org.Item1;

             attr = originProperty.GetCustomAttribute<DisplayNameAttribute>();
             if (attr != null)
@@ -317,7 +323,7 @@
             var originOrigin = originProperty.GetCustomAttribute<OriginAttribute>();
             if (originOrigin != null)
             {
-                var originDictionary = GetPropertyDictionary(originProperty.ReflectedType);
+                var originDictionary = GetPropertyDictionary(org.Item2);
                 return addPrefix(originDictionary.OriginDisplayName(originProperty, originOrigin));
             }


Add JS dialog handler to notifications

Add JS dialog handler to notifications

--- Core/Notification/FormNotificationBase.cs
+++ Core/Notification/FormNotificationBase.cs
@@ -98,6 +98,7 @@

             this.browser = new ChromiumWebBrowser("about:blank"){
                 MenuHandler = new ContextMenuNotification(this, enableContextMenu),
+                JsDialogHandler = new JavaScriptDialogHandler(),
                 LifeSpanHandler = new LifeSpanHandler()
             };


Fix - version comparison for update were wrong

--- Core/Theraot/Threading/VersionProvider.cs
+++ Core/Theraot/Threading/VersionProvider.cs
@@ -69,7 +69,7 @@
             public VersionToken Clone()
             {
                 VersionToken result = new VersionToken(_provider, _target, _number);
-                if (result.CompareTo(this) > 1)
+                if (result.CompareTo(this) > 0)
                 {
                     SpinWait wait = new SpinWait();
                     do
@@ -77,7 +77,7 @@
                         result._number = _number;
                         result._target = _target;
                         wait.SpinOnce();
-                    } while (result.CompareTo(this) > 1);
+                    } while (result.CompareTo(this) > 0);
                 }
                 return result;
             }
@@ -184,7 +184,7 @@
                     {
                         updated = true;
                     }
-                    if (this.CompareTo(other) > 1)
+                    if (this.CompareTo(other) > 0)
                     {
                         SpinWait wait = new SpinWait();
                         do
@@ -198,7 +198,7 @@
                                 updated = true;
                             }
                             wait.SpinOnce();
-                        } while (this.CompareTo(other) > 1);
+                        } while (this.CompareTo(other) > 0);
                     }
                     if (updated)
                     {
@@ -212,7 +212,7 @@
                 var newTarget = _provider._target;
                 Interlocked.Exchange<Target>(ref _target, newTarget);
                 Interlocked.Exchange(ref _number, newTarget.Number);
-                if (this.CompareTo(other) > 1)
+                if (this.CompareTo(other) > 0)
                 {
                     SpinWait wait = new SpinWait();
                     do
@@ -220,7 +220,7 @@
                         Interlocked.Exchange<Target>(ref _target, newTarget);
                         Interlocked.Exchange(ref _number, other._number);
                         wait.SpinOnce();
-                    } while (this.CompareTo(other) > 1);
+                    } while (this.CompareTo(other) > 0);
                 }
             }
         }