Apply `Bindable.Parse` refactorings

This commit is contained in:
Dean Herbert 2023-12-13 14:07:38 +09:00
parent ae8a70ddfc
commit 0be6743e87
No known key found for this signature in database
6 changed files with 9 additions and 6 deletions

View File

@ -121,7 +121,7 @@ private void tryUpdateSliderFromTextBox()
break;
default:
slider.Current.Parse(textBox.Current.Value);
slider.Current.Parse(textBox.Current.Value, CultureInfo.CurrentCulture);
break;
}
}

View File

@ -84,7 +84,7 @@ protected override void AddBindable<TBindable>(TLookup lookup, Bindable<TBindabl
if (setting != null)
{
bindable.Parse(setting.Value);
bindable.Parse(setting.Value, CultureInfo.InvariantCulture);
}
else
{

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Reflection;
using Newtonsoft.Json;
@ -284,7 +285,7 @@ internal virtual void CopyAdjustedSetting(IBindable target, object source)
if (!(target is IParseable parseable))
throw new InvalidOperationException($"Bindable type {target.GetType().ReadableName()} is not {nameof(IParseable)}.");
parseable.Parse(source);
parseable.Parse(source, CultureInfo.InvariantCulture);
}
}

View File

@ -103,7 +103,7 @@ public IndeterminateSliderWithTextBoxInput(LocalisableString labelText, Bindable
break;
default:
slider.Current.Parse(t.Text);
slider.Current.Parse(t.Text, CultureInfo.CurrentCulture);
break;
}
}

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Globalization;
using osu.Framework.Bindables;
using osu.Framework.Extensions.TypeExtensions;
using osu.Framework.Graphics;
@ -46,7 +47,7 @@ void CopyAdjustedSetting(IBindable target, object source)
if (!(target is IParseable parseable))
throw new InvalidOperationException($"Bindable type {target.GetType().ReadableName()} is not {nameof(IParseable)}.");
parseable.Parse(source);
parseable.Parse(source, CultureInfo.InvariantCulture);
}
}
}

View File

@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using JetBrains.Annotations;
@ -330,7 +331,7 @@ protected override void ParseConfigurationStream(Stream stream)
var bindable = new Bindable<TValue>();
if (val != null)
bindable.Parse(val);
bindable.Parse(val, CultureInfo.InvariantCulture);
return bindable;
}
}