Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
Update nuget packages and refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed Apr 11, 2019
1 parent 1dca3a5 commit c5d62e7
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
4 changes: 2 additions & 2 deletions OsuHelper/Converters/ModsToStringConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public class ModsToStringConverter : IValueConverter

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
throw new ArgumentNullException(nameof(value));
if (value is null)
return null;

var mods = (Mods) value;

Expand Down
10 changes: 5 additions & 5 deletions OsuHelper/Converters/TimeSpanToShortStringConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ public class TimeSpanToShortStringConverter : IValueConverter

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
throw new ArgumentNullException(nameof(value));
if (value is null)
return null;

var ts = (TimeSpan) value;
var fullMins = ts.Hours*60 + ts.Minutes;
var time = (TimeSpan) value;
var fullMins = time.Hours * 60 + time.Minutes;

return $"{fullMins:00}:{ts.Seconds:00}";
return $"{fullMins:00}:{time.Seconds:00}";
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Expand Down
11 changes: 8 additions & 3 deletions OsuHelper/FodyWeavers.xsd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuild. -->
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
Expand Down Expand Up @@ -36,12 +36,17 @@
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification on the target assembly after all weavers have been finished.</xs:documentation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
Expand Down
6 changes: 3 additions & 3 deletions OsuHelper/OsuHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
<Version>1.1.3</Version>
</PackageReference>
<PackageReference Include="MaterialDesignThemes">
<Version>2.5.0.1205</Version>
<Version>2.5.1</Version>
</PackageReference>
<PackageReference Include="NAudio">
<Version>1.8.5</Version>
Expand All @@ -157,13 +157,13 @@
<Version>2.4.2</Version>
</PackageReference>
<PackageReference Include="PropertyChanged.Fody">
<Version>2.6.0</Version>
<Version>2.6.1</Version>
</PackageReference>
<PackageReference Include="Stylet">
<Version>1.1.22</Version>
</PackageReference>
<PackageReference Include="Tyrrrz.Extensions">
<Version>1.6.0</Version>
<Version>1.6.1</Version>
</PackageReference>
<PackageReference Include="Tyrrrz.Settings">
<Version>1.3.4</Version>
Expand Down
2 changes: 1 addition & 1 deletion OsuHelper/ViewModels/Dialogs/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public string UserId
if (value != null)
{
var fromUrl = Regex.Match(value, @".*?.ppy.sh/\w/([\w\d]+)").Groups[1].Value;
_settingsService.UserId = !fromUrl.IsEmpty() ? fromUrl : value;
_settingsService.UserId = !fromUrl.IsNullOrWhiteSpace() ? fromUrl : value;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion OsuHelper/ViewModels/RootViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public async void PopulateRecommendations()
try
{
// Validate settings
if (_settingsService.UserId == null || _settingsService.ApiKey == null)
if (_settingsService.UserId.IsNullOrWhiteSpace() || _settingsService.ApiKey.IsNullOrWhiteSpace())
{
Notifications.Enqueue("Not configured – set username and API key in settings",
"OPEN", ShowSettings);
Expand Down

0 comments on commit c5d62e7

Please sign in to comment.