mirror of https://github.com/ppy/osu
Apply `Bindable.Parse` refactorings
This commit is contained in:
parent
ae8a70ddfc
commit
0be6743e87
|
@ -121,7 +121,7 @@ private void tryUpdateSliderFromTextBox()
|
|||
break;
|
||||
|
||||
default:
|
||||
slider.Current.Parse(textBox.Current.Value);
|
||||
slider.Current.Parse(textBox.Current.Value, CultureInfo.CurrentCulture);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ public IndeterminateSliderWithTextBoxInput(LocalisableString labelText, Bindable
|
|||
break;
|
||||
|
||||
default:
|
||||
slider.Current.Parse(t.Text);
|
||||
slider.Current.Parse(t.Text, CultureInfo.CurrentCulture);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue