Skip to content

Commit e084a44

Browse files
committed
Rename value converters.
1 parent 00b6af5 commit e084a44

File tree

54 files changed

+148
-146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+148
-146
lines changed

samples/Unity.Mvvm.Calc/Assets/Scripts/AppContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using MathOperations;
55
using Models;
66
using UnityEngine;
7-
using UnityMvvmToolkit.Core.Converters.ValueConverters;
7+
using UnityMvvmToolkit.Core.Converters.PropertyValueConverters;
88
using ViewModels;
99

1010
public class AppContext : MonoBehaviour, IAppContext

samples/Unity.Mvvm.Calc/Assets/Scripts/Models/CalcModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using Interfaces;
4-
using UnityMvvmToolkit.Core.Converters.ValueConverters;
4+
using UnityMvvmToolkit.Core.Converters.PropertyValueConverters;
55

66
namespace Models
77
{

samples/Unity.Mvvm.Counter/Assets/Scripts/AppContext.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Interfaces.Services;
55
using Services;
66
using UnityEngine;
7-
using UnityMvvmToolkit.Core.Converters.ValueConverters;
7+
using UnityMvvmToolkit.Core.Converters.PropertyValueConverters;
88
using UnityMvvmToolkit.Core.Interfaces;
99
using ValueConverters;
1010
using ViewModels;
@@ -23,7 +23,7 @@ public void Construct()
2323
RegisterInstance(new CounterViewModel());
2424
RegisterInstance<IDataStoreService>(new DataStoreService(this));
2525
RegisterInstance<IBindableElementsWrapper>(new CounterBindableElementsWrapper());
26-
RegisterInstance(GetConverters());
26+
RegisterInstance(GetValueConverters());
2727
}
2828

2929
public T Resolve<T>()
@@ -36,9 +36,9 @@ private void RegisterInstance<T>(T instance)
3636
_registeredTypes.Add(typeof(T), instance);
3737
}
3838

39-
private IConverter[] GetConverters()
39+
private IValueConverter[] GetValueConverters()
4040
{
41-
return new IConverter[]
41+
return new IValueConverter[]
4242
{
4343
new IntToStrConverter(),
4444
new ThemeModeToBoolConverter()

samples/Unity.Mvvm.Counter/Assets/Scripts/ValueConverters/ThemeModeToBoolConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System.Runtime.CompilerServices;
22
using Enums;
3-
using UnityMvvmToolkit.Core.Converters.ValueConverters;
3+
using UnityMvvmToolkit.Core.Converters.PropertyValueConverters;
44

55
namespace ValueConverters
66
{
7-
public class ThemeModeToBoolConverter : ValueConverter<ThemeMode, bool>
7+
public class ThemeModeToBoolConverter : PropertyValueConverter<ThemeMode, bool>
88
{
99
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1010
public override bool Convert(ThemeMode value)

samples/Unity.Mvvm.Counter/Assets/Scripts/Views/BaseView.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ protected override TBindingContext GetBindingContext()
2424
return _appContext.Resolve<TBindingContext>();
2525
}
2626

27-
protected override IConverter[] GetValueConverters()
27+
protected override IValueConverter[] GetValueConverters()
2828
{
29-
return _appContext.Resolve<IConverter[]>();
29+
return _appContext.Resolve<IValueConverter[]>();
3030
}
3131

3232
protected override IBindableElementsWrapper GetBindableElementsWrapper()
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using UnityMvvmToolkit.Core.Converters.ValueConverters;
1+
using UnityMvvmToolkit.Core.Converters.PropertyValueConverters;
22
using UnityMvvmToolkit.Core.Interfaces;
33
using UnityMvvmToolkit.UGUI;
44
using ViewModels;
@@ -7,9 +7,9 @@ namespace Views
77
{
88
public class CounterView : CanvasView<CounterViewModel>
99
{
10-
protected override IConverter[] GetValueConverters()
10+
protected override IValueConverter[] GetValueConverters()
1111
{
12-
return new IConverter[] { new IntToStrConverter() };
12+
return new IValueConverter[] { new IntToStrConverter() };
1313
}
1414
}
1515
}

src/UnityMvvmToolkit.Core/BindingContextObjectProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class BindingContextObjectProvider<TBindingContext> : IObjectProvider
1010
private readonly CommandProvider<TBindingContext> _commandProvider;
1111
private readonly PropertyProvider<TBindingContext> _propertyProvider;
1212

13-
public BindingContextObjectProvider(TBindingContext bindingContext, IConverter[] converters)
13+
public BindingContextObjectProvider(TBindingContext bindingContext, IValueConverter[] converters)
1414
{
1515
_commandProvider = new CommandProvider<TBindingContext>(bindingContext, converters);
1616
_propertyProvider = new PropertyProvider<TBindingContext>(bindingContext, converters);

src/UnityMvvmToolkit.Core/Converters/ParameterConverters/ParameterToFloatConverter.cs renamed to src/UnityMvvmToolkit.Core/Converters/ParameterValueConverters/ParameterToFloatConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
using System.Runtime.CompilerServices;
33
using UnityMvvmToolkit.Core.Extensions;
44

5-
namespace UnityMvvmToolkit.Core.Converters.ParameterConverters
5+
namespace UnityMvvmToolkit.Core.Converters.ParameterValueConverters
66
{
7-
public class ParameterToFloatConverter : ParameterConverter<float>
7+
public class ParameterToFloatConverter : ParameterValueConverter<float>
88
{
99
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1010
public override float Convert(ReadOnlyMemory<char> parameter)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System;
22
using System.Runtime.CompilerServices;
33

4-
namespace UnityMvvmToolkit.Core.Converters.ParameterConverters
4+
namespace UnityMvvmToolkit.Core.Converters.ParameterValueConverters
55
{
6-
public class ParameterToIntConverter : ParameterConverter<int>
6+
public class ParameterToIntConverter : ParameterValueConverter<int>
77
{
88
[MethodImpl(MethodImplOptions.AggressiveInlining)]
99
public override int Convert(ReadOnlyMemory<char> parameter)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System;
22
using System.Runtime.CompilerServices;
33

4-
namespace UnityMvvmToolkit.Core.Converters.ParameterConverters
4+
namespace UnityMvvmToolkit.Core.Converters.ParameterValueConverters
55
{
6-
public class ParameterToStrConverter : ParameterConverter<string>
6+
public class ParameterToStrConverter : ParameterValueConverter<string>
77
{
88
[MethodImpl(MethodImplOptions.AggressiveInlining)]
99
public override string Convert(ReadOnlyMemory<char> parameter)

0 commit comments

Comments
 (0)