Skip to content

Commit 2b4564e

Browse files
committed
Refactoring.
1 parent 538a683 commit 2b4564e

File tree

44 files changed

+294
-260
lines changed

Some content is hidden

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

44 files changed

+294
-260
lines changed

src/UnityMvvmToolkit.Core/Converters/PropertyValueConverters/PropertyValueConverter.cs renamed to src/UnityMvvmToolkit.Core/Converters/PropertyValueConverters/PropertyValueConverter.TSource.TTarget.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@
44

55
namespace UnityMvvmToolkit.Core.Converters.PropertyValueConverters
66
{
7-
public abstract class PropertyValueConverter<TSourceType, TTargetType>
8-
: IPropertyValueConverter<TSourceType, TTargetType>
7+
public abstract class PropertyValueConverter<TSource, TTarget>
8+
: IPropertyValueConverter<TSource, TTarget>
99
{
1010
protected PropertyValueConverter()
1111
{
1212
Name = GetType().Name;
13-
SourceType = typeof(TSourceType);
14-
TargetType = typeof(TTargetType);
13+
SourceType = typeof(TSource);
14+
TargetType = typeof(TTarget);
1515
}
1616

1717
public string Name { get; }
1818
public Type SourceType { get; }
1919
public Type TargetType { get; }
2020

2121
[MethodImpl(MethodImplOptions.AggressiveInlining)]
22-
public abstract TTargetType Convert(TSourceType value);
22+
public abstract TTarget Convert(TSource value);
2323

2424
[MethodImpl(MethodImplOptions.AggressiveInlining)]
25-
public abstract TSourceType ConvertBack(TTargetType value);
25+
public abstract TSource ConvertBack(TTarget value);
2626
}
2727
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Runtime.CompilerServices;
2+
3+
namespace UnityMvvmToolkit.Core.Interfaces
4+
{
5+
public interface IParameterValueConverter<out TTargetType> : IParameterValueConverter
6+
{
7+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
8+
TTargetType Convert(string parameter);
9+
}
10+
}
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
using System;
2-
using System.Runtime.CompilerServices;
32

43
namespace UnityMvvmToolkit.Core.Interfaces
54
{
65
public interface IParameterValueConverter : IValueConverter
76
{
87
Type TargetType { get; }
98
}
10-
11-
public interface IParameterValueConverter<out TTargetType> : IParameterValueConverter
12-
{
13-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
14-
TTargetType Convert(string parameter);
15-
}
169
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System.Runtime.CompilerServices;
2+
3+
namespace UnityMvvmToolkit.Core.Interfaces
4+
{
5+
public interface IProperty<T> : IReadOnlyProperty<T>
6+
{
7+
new T Value { get; set; }
8+
9+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
10+
bool TrySetValue(T value);
11+
12+
internal void ForceSetValue(T value);
13+
}
14+
}

src/UnityMvvmToolkit.Core/Interfaces/IProperty.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System.Runtime.CompilerServices;
2+
3+
namespace UnityMvvmToolkit.Core.Interfaces
4+
{
5+
public interface IPropertyValueConverter<TSource, TTarget> : IPropertyValueConverter
6+
{
7+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
8+
TTarget Convert(TSource value);
9+
10+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
11+
TSource ConvertBack(TTarget value);
12+
}
13+
}
Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Runtime.CompilerServices;
32

43
namespace UnityMvvmToolkit.Core.Interfaces
54
{
@@ -8,13 +7,4 @@ public interface IPropertyValueConverter : IValueConverter
87
Type SourceType { get; }
98
Type TargetType { get; }
109
}
11-
12-
public interface IPropertyValueConverter<TSourceType, TTargetType> : IPropertyValueConverter
13-
{
14-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
15-
TTargetType Convert(TSourceType value);
16-
17-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
18-
TSourceType ConvertBack(TTargetType value);
19-
}
2010
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System;
2+
3+
namespace UnityMvvmToolkit.Core.Interfaces
4+
{
5+
public interface IReadOnlyProperty<T> : IBaseProperty
6+
{
7+
T Value { get; }
8+
9+
event EventHandler<T> ValueChanged;
10+
}
11+
}

src/UnityMvvmToolkit.Core/Interfaces/IReadOnlyProperty.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)