Skip to content

Commit

Permalink
Update remaining packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanLarsson committed Jun 14, 2016
1 parent 7b112fe commit bb79a4d
Show file tree
Hide file tree
Showing 18 changed files with 132 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void CentimetresPerMinute()
var centi = new Prefix("Centi", "c", -2);
settings.Prefixes.Add(centi);
var centimetresConversion = PrefixConversion.Create(settings.Metres, centi);
var minuteConversion = new Generator.FactorConversion("Minute", "min", 60);
var minuteConversion = new FactorConversion("Minute", "min", 60);
settings.Seconds.FactorConversions.Add(minuteConversion);
settings.Metres.PrefixConversions.Add(centimetresConversion);
var centiMetresPart = PartConversion.CreatePart(1, centimetresConversion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ public Data(string value, string formatted, params UnitAndPower[] parts)
this.Parts = parts;
}

public string Value { get; private set; }
public string Value { get; }

public string Formatted { get; private set; }
public string Formatted { get; }

public IEnumerable<UnitAndPower> Parts { get; private set; }
public IEnumerable<UnitAndPower> Parts { get; }

public override string ToString()
{
var units = string.Join(", ", this.Parts.Select(x => $"{x.Unit.Symbol}^{x.Power}"));
return $"{Value} Formatted: {Formatted} Units: {{{units}}}";
return $"{this.Value} Formatted: {this.Formatted} Units: {{{units}}}";
}
}
}
Expand Down
19 changes: 14 additions & 5 deletions Gu.Units.Generator.Tests/Gu.Units.Generator.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2')">
<ItemGroup>
<Reference Include="Gu.ChangeTracking">
<HintPath>..\packages\Gu.ChangeTracking\lib\net45\Gu.ChangeTracking.dll</HintPath>
<Reference Include="Gu.Reactive">
<HintPath>..\packages\Gu.Reactive\lib\net45\Gu.Reactive.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
Expand All @@ -164,8 +164,8 @@
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2')">
<ItemGroup>
<Reference Include="Gu.Reactive">
<HintPath>..\packages\Gu.Reactive\lib\net45\Gu.Reactive.dll</HintPath>
<Reference Include="Gu.State">
<HintPath>..\packages\Gu.State\lib\net45\Gu.State.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
Expand Down Expand Up @@ -817,7 +817,16 @@
</When>
</Choose>
<Choose>
<When Condition="($(TargetFrameworkIdentifier) == '.NETCore') Or ($(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2')) Or ($(TargetFrameworkIdentifier) == 'MonoAndroid') Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkProfile) == 'Profile7') Or ($(TargetFrameworkProfile) == 'Profile44')">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2')">
<ItemGroup>
<Reference Include="System.Reflection.Metadata">
<HintPath>..\packages\System.Reflection.Metadata\lib\netstandard1.1\System.Reflection.Metadata.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="($(TargetFrameworkIdentifier) == '.NETCore') Or ($(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5') Or ($(TargetFrameworkIdentifier) == 'MonoAndroid') Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkProfile) == 'Profile7') Or ($(TargetFrameworkProfile) == 'Profile44')">
<ItemGroup>
<Reference Include="System.Reflection.Metadata">
<HintPath>..\packages\System.Reflection.Metadata\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public int Compare(FactorConversion x, FactorConversion y)

int IComparer.Compare(object x, object y)
{
return Compare((FactorConversion) x, (FactorConversion) y);
return this.Compare((FactorConversion) x, (FactorConversion) y);
}
}
}
4 changes: 2 additions & 2 deletions Gu.Units.Generator.Tests/Helpers/FieldComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ private FieldComparer()

public int Compare(object x, object y)
{
return Compare(x, y, new List<ComparedPair>());
return this.Compare(x, y, new List<ComparedPair>());
}

private int Compare(object x, object y, List<ComparedPair> compared)
Expand Down Expand Up @@ -55,7 +55,7 @@ private int Compare(object x, object y, List<ComparedPair> compared)
}

compared.Add(new ComparedPair(oX, oY));
if (Compare(oX, oY, compared) != 0)
if (this.Compare(oX, oY, compared) != 0)
{
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion Gu.Units.Generator.Tests/Helpers/PrefixComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public int Compare(Prefix x, Prefix y)

int IComparer.Compare(object x, object y)
{
return Compare((Prefix) x, (Prefix) y);
return this.Compare((Prefix) x, (Prefix) y);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public int Compare(PrefixConversion x, PrefixConversion y)

int IComparer.Compare(object x, object y)
{
return Compare((PrefixConversion)x, (PrefixConversion)y);
return this.Compare((PrefixConversion)x, (PrefixConversion)y);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public int Compare(PrefixConversionVm x, PrefixConversionVm y)

int IComparer.Compare(object x, object y)
{
return Compare((PrefixConversionVm)x, (PrefixConversionVm)y);
return this.Compare((PrefixConversionVm)x, (PrefixConversionVm)y);
}
}
}
2 changes: 1 addition & 1 deletion Gu.Units.Generator.Tests/Helpers/UnitComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public int Compare(BaseUnit x, BaseUnit y)

int IComparer.Compare(object x, object y)
{
return Compare((BaseUnit)x, (BaseUnit)y);
return this.Compare((BaseUnit)x, (BaseUnit)y);
}
}
}
38 changes: 19 additions & 19 deletions Gu.Units.Generator.Tests/MockSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,29 @@ public class MockSettings : Settings
private MockSettings()
: base(new ObservableCollection<Prefix>(), new ObservableCollection<BaseUnit>(), new ObservableCollection<DerivedUnit>())
{
Prefixes.Add(this.Micro);
Prefixes.Add(this.Milli);
Prefixes.Add(this.Kilo);
this.Prefixes.Add(this.Micro);
this.Prefixes.Add(this.Milli);
this.Prefixes.Add(this.Kilo);
this.Metres = new BaseUnit("Metres", "m", "Length");
BaseUnits.Add(this.Metres);
this.BaseUnits.Add(this.Metres);
this.Length = this.Metres.Quantity;

this.Kelvins = new BaseUnit("Kelvin", "K", "Temperature");
BaseUnits.Add(this.Kelvins);
this.BaseUnits.Add(this.Kelvins);
this.Temperature = this.Kelvins.Quantity;

this.Seconds = new BaseUnit("Seconds", "s", "Time");
BaseUnits.Add(this.Seconds);
this.BaseUnits.Add(this.Seconds);
this.Time = this.Seconds.Quantity;

this.Kilograms = new BaseUnit("Kilograms", "kg", "Mass");
this.Grams = new FactorConversion("Grams", "g", 0.001);
this.Kilograms.FactorConversions.Add(this.Grams);
BaseUnits.Add(this.Kilograms);
this.BaseUnits.Add(this.Kilograms);
this.Mass = this.Kilograms.Quantity;

this.Amperes = new BaseUnit("Amperes", "A", "ElectricalCurrent");
BaseUnits.Add(this.Amperes);
this.BaseUnits.Add(this.Amperes);
this.Current = this.Amperes.Quantity;

this.MetresPerSecond = new DerivedUnit(
Expand All @@ -90,7 +90,7 @@ private MockSettings()
"Speed",
new[]{ UnitAndPower.Create(this.Metres, 1),
UnitAndPower.Create(this.Seconds, -1)});
DerivedUnits.Add(this.MetresPerSecond);
this.DerivedUnits.Add(this.MetresPerSecond);
this.Speed = this.MetresPerSecond.Quantity;

this.MetresPerSecondSquared = new DerivedUnit(
Expand All @@ -102,7 +102,7 @@ private MockSettings()
UnitAndPower.Create(this.Metres, 1),
UnitAndPower.Create(this.Seconds, -2)
});
DerivedUnits.Add(this.MetresPerSecondSquared);
this.DerivedUnits.Add(this.MetresPerSecondSquared);
this.Acceleration = this.MetresPerSecondSquared.Quantity;

this.Newtons = new DerivedUnit(
Expand All @@ -112,7 +112,7 @@ private MockSettings()
new[]{ UnitAndPower.Create(this.Kilograms, 1),
UnitAndPower.Create(this.Metres, 1),
UnitAndPower.Create(this.Seconds, -2)});
DerivedUnits.Add(this.Newtons);
this.DerivedUnits.Add(this.Newtons);
this.Force = this.Newtons.Quantity;

this.Joules = new DerivedUnit(
Expand All @@ -121,7 +121,7 @@ private MockSettings()
"Energy",
new[]{ UnitAndPower.Create(this.Newtons, 1),
UnitAndPower.Create(this.Metres, 1)});
DerivedUnits.Add(this.Joules);
this.DerivedUnits.Add(this.Joules);
this.Energy = this.Joules.Quantity;

this.Watts = new DerivedUnit(
Expand All @@ -130,7 +130,7 @@ private MockSettings()
"Power",
new[]{ UnitAndPower.Create(this.Joules, 1),
UnitAndPower.Create(this.Seconds, -1)});
DerivedUnits.Add(this.Watts);
this.DerivedUnits.Add(this.Watts);
this.Power = this.Watts.Quantity;

this.Volts = new DerivedUnit(
Expand All @@ -139,7 +139,7 @@ private MockSettings()
"Voltage",
new[]{ UnitAndPower.Create(this.Watts, 1),
UnitAndPower.Create(this.Amperes, -1)});
DerivedUnits.Add(this.Volts);
this.DerivedUnits.Add(this.Volts);
this.Voltage = this.Volts.Quantity;

this.Coloumbs = new DerivedUnit(
Expand All @@ -148,24 +148,24 @@ private MockSettings()
"ElectricCharge",
new[]{ UnitAndPower.Create(this.Seconds, 1),
UnitAndPower.Create(this.Amperes, 1)});
DerivedUnits.Add(this.Coloumbs);
this.DerivedUnits.Add(this.Coloumbs);
this.ElectricCharge = this.Coloumbs.Quantity;

this.SquareMetres = new DerivedUnit("SquareMetres", "m^2", "Area", new[] { UnitAndPower.Create(this.Metres, 2) });
DerivedUnits.Add(this.SquareMetres);
this.DerivedUnits.Add(this.SquareMetres);
this.Area = this.SquareMetres.Quantity;

this.CubicMetres = new DerivedUnit("CubicMetres", "m^3", "Volume", new[] { UnitAndPower.Create(this.Metres, 3) });
DerivedUnits.Add(this.CubicMetres);
this.DerivedUnits.Add(this.CubicMetres);
this.Volume = this.CubicMetres.Quantity;

this.KilogramsPerCubicMetre = new DerivedUnit("KilogramsPerCubicMetre", "kg/m^3", "Density", new[] {UnitAndPower.Create(this.Kilograms,1), UnitAndPower.Create(this.Metres, -3) });
DerivedUnits.Add(this.KilogramsPerCubicMetre);
this.DerivedUnits.Add(this.KilogramsPerCubicMetre);
this.Density = this.CubicMetres.Quantity;

this.Hertz = new DerivedUnit("Hertz", "1/s", "Frequency", new[] { UnitAndPower.Create(this.Seconds, -1) });

DerivedUnits.Add(this.Hertz);
this.DerivedUnits.Add(this.Hertz);
this.Frequency = this.Hertz.Quantity;
}

Expand Down
6 changes: 3 additions & 3 deletions Gu.Units.Generator.Tests/paket.references
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Moq
NUnit
Gu.Wpf.Reactive
Gu.ChangeTracking
Newtonsoft.Json
Microsoft.CodeAnalysis.CSharp.Scripting
Microsoft.CodeAnalysis.CSharp.Scripting
Gu.Wpf.Reactive
Gu.State
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public string ToSi
this.OnPropertyChanged(nameof(this.CanRoundtrip));
try
{
var temp = ExpressionParser.Evaluate(1, this.ParameterName, value);
ExpressionParser.Evaluate(1, this.ParameterName, value);
}
catch (Exception e)
{
Expand All @@ -102,7 +102,7 @@ public string FromSi

try
{
var temp = ExpressionParser.Evaluate(1, this.Unit.ParameterName, value);
ExpressionParser.Evaluate(1, this.Unit.ParameterName, value);
}
catch (Exception e)
{
Expand Down
23 changes: 21 additions & 2 deletions Gu.Units.Generator/Gu.Units.Generator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
<HintPath>..\packages\Microsoft.CodeAnalysis.Scripting.Common\lib\dotnet\Microsoft.CodeAnalysis.Scripting.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
Expand Down Expand Up @@ -498,6 +497,17 @@
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2')">
<ItemGroup>
<Reference Include="Gu.State">
<HintPath>..\packages\Gu.State\lib\net45\Gu.State.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2')">
<ItemGroup>
Expand Down Expand Up @@ -1148,7 +1158,16 @@
</When>
</Choose>
<Choose>
<When Condition="($(TargetFrameworkIdentifier) == '.NETCore') Or ($(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2')) Or ($(TargetFrameworkIdentifier) == 'MonoAndroid') Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkProfile) == 'Profile7') Or ($(TargetFrameworkProfile) == 'Profile44')">
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2')">
<ItemGroup>
<Reference Include="System.Reflection.Metadata">
<HintPath>..\packages\System.Reflection.Metadata\lib\netstandard1.1\System.Reflection.Metadata.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="($(TargetFrameworkIdentifier) == '.NETCore') Or ($(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5') Or ($(TargetFrameworkIdentifier) == 'MonoAndroid') Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkProfile) == 'Profile7') Or ($(TargetFrameworkProfile) == 'Profile44')">
<ItemGroup>
<Reference Include="System.Reflection.Metadata">
<HintPath>..\packages\System.Reflection.Metadata\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath>
Expand Down
6 changes: 3 additions & 3 deletions Gu.Units.Generator/paket.references
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
T4.TemplateFileManager
Gu.Wpf.Reactive
Gu.ChangeTracking
JetBrains.Annotations
Newtonsoft.Json
Microsoft.CodeAnalysis.CSharp.Scripting
Microsoft.CodeAnalysis.CSharp.Scripting
Gu.Wpf.Reactive
Gu.State
2 changes: 1 addition & 1 deletion Gu.Units.Tests/BenchMarks/FormattingBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void ForProfiling()
var toString = speed.ToString("F1 m/s");
toString = speed.ToString("F0", "s⁻¹⋅mm");
toString = speed.ToString("F2 m⋅s⁻¹");
var string_Format = $"{speed.metresPerSecond:F1} {SpeedUnit.MetresPerSecond}";
var stringFormat = $"{speed.metresPerSecond:F1} {SpeedUnit.MetresPerSecond}";
// end warmup

var n = 1000000;
Expand Down
Loading

0 comments on commit bb79a4d

Please sign in to comment.