Skip to content

Commit c74d458

Browse files
authored
Merge pull request #128 from Tynamix/feature/update_framework_moniker
added netstandard1.3 and netstandard2.0 for easier usage of the library
2 parents 2425cff + 2d39383 commit c74d458

File tree

5 files changed

+200
-182
lines changed

5 files changed

+200
-182
lines changed

ObjectFillerNET.sln

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26430.16
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30907.101
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0EC5FD26-A565-4D47-A192-0FC142C3B7F0}"
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tynamix.ObjectFiller", "Tynamix.ObjectFiller\Tynamix.ObjectFiller.csproj", "{7F8E176C-12A7-45B7-886E-5A4923B2F252}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tynamix.ObjectFiller.Test", "Tynamix.ObjectFiller.Test\Tynamix.ObjectFiller.Test.csproj", "{F2BFBBDC-E8A0-4263-AD9A-DDC87C4CD4DE}"
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tynamix.ObjectFiller.Test", "Tynamix.ObjectFiller.Test\Tynamix.ObjectFiller.Test.csproj", "{F2BFBBDC-E8A0-4263-AD9A-DDC87C4CD4DE}"
1111
EndProject
1212
Global
1313
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -27,6 +27,9 @@ Global
2727
GlobalSection(SolutionProperties) = preSolution
2828
HideSolutionNode = FALSE
2929
EndGlobalSection
30+
GlobalSection(ExtensibilityGlobals) = postSolution
31+
SolutionGuid = {49C4194A-811F-47D8-A814-46F89C1B897E}
32+
EndGlobalSection
3033
GlobalSection(TestCaseManagementSettings) = postSolution
3134
CategoryFile = ObjectFillerNET.vsmdi
3235
EndGlobalSection

Tynamix.ObjectFiller/NetTypeApiExtension.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ internal static class NetTypeApiExtension
99
{
1010
internal static bool IsEnum(this Type source)
1111
{
12-
#if NETSTANDARD1_0
12+
#if NETSTANDARD
1313
return source.GetTypeInfo().IsEnum;
1414
#else
1515
return source.IsEnum;
@@ -18,7 +18,7 @@ internal static bool IsEnum(this Type source)
1818

1919
internal static PropertyInfo GetProperty(this Type source, string name)
2020
{
21-
#if NETSTANDARD1_0
21+
#if NETSTANDARD
2222
return source.GetTypeInfo().GetDeclaredProperty(name);
2323
#else
2424
return source.GetProperty(name);
@@ -27,7 +27,7 @@ internal static PropertyInfo GetProperty(this Type source, string name)
2727

2828
internal static IEnumerable<MethodInfo> GetMethods(this Type source)
2929
{
30-
#if NETSTANDARD1_0
30+
#if NETSTANDARD
3131
return source.GetTypeInfo().DeclaredMethods;
3232
#else
3333
return source.GetMethods();
@@ -36,7 +36,7 @@ internal static IEnumerable<MethodInfo> GetMethods(this Type source)
3636

3737
internal static MethodInfo GetSetterMethod(this PropertyInfo source)
3838
{
39-
#if NETSTANDARD1_0
39+
#if NETSTANDARD
4040
return source.SetMethod;
4141
#else
4242
return source.GetSetMethod(true);
@@ -45,7 +45,7 @@ internal static MethodInfo GetSetterMethod(this PropertyInfo source)
4545

4646
internal static bool IsGenericType(this Type source)
4747
{
48-
#if NETSTANDARD1_0
48+
#if NETSTANDARD
4949
return source.GetTypeInfo().IsGenericType;
5050
#else
5151
return source.IsGenericType;
@@ -55,7 +55,7 @@ internal static bool IsGenericType(this Type source)
5555
internal static bool IsValueType(this Type source)
5656
{
5757

58-
#if NETSTANDARD1_0
58+
#if NETSTANDARD
5959
return source.GetTypeInfo().IsValueType;
6060
#else
6161
return source.IsValueType;
@@ -64,7 +64,7 @@ internal static bool IsValueType(this Type source)
6464

6565
internal static bool IsClass(this Type source)
6666
{
67-
#if NETSTANDARD1_0
67+
#if NETSTANDARD
6868
return source.GetTypeInfo().IsClass;
6969
#else
7070
return source.IsClass;
@@ -73,7 +73,7 @@ internal static bool IsClass(this Type source)
7373

7474
internal static bool IsInterface(this Type source)
7575
{
76-
#if NETSTANDARD1_0
76+
#if NETSTANDARD
7777
return source.GetTypeInfo().IsInterface;
7878
#else
7979
return source.IsInterface;
@@ -82,7 +82,7 @@ internal static bool IsInterface(this Type source)
8282

8383
internal static bool IsAbstract(this Type source)
8484
{
85-
#if NETSTANDARD1_0
85+
#if NETSTANDARD
8686
return source.GetTypeInfo().IsAbstract;
8787
#else
8888
return source.IsAbstract;
@@ -91,7 +91,7 @@ internal static bool IsAbstract(this Type source)
9191

9292
internal static IEnumerable<Type> GetImplementedInterfaces(this Type source)
9393
{
94-
#if NETSTANDARD1_0
94+
#if NETSTANDARD
9595
return source.GetTypeInfo().ImplementedInterfaces;
9696
#else
9797
return source.GetInterfaces();
@@ -100,7 +100,7 @@ internal static IEnumerable<Type> GetImplementedInterfaces(this Type source)
100100

101101
internal static IEnumerable<PropertyInfo> GetProperties(this Type source, bool ignoreInheritance)
102102
{
103-
#if NETSTANDARD1_0
103+
#if NETSTANDARD
104104

105105
var propertyInfos = source.GetTypeInfo().DeclaredProperties.ToList();
106106

@@ -129,7 +129,7 @@ internal static IEnumerable<PropertyInfo> GetProperties(this Type source, bool i
129129

130130
internal static Type[] GetGenericTypeArguments(this Type source)
131131
{
132-
#if NETSTANDARD1_0
132+
#if NETSTANDARD
133133
return source.GetTypeInfo().GenericTypeArguments;
134134
#else
135135
return source.GetGenericArguments();
@@ -138,7 +138,7 @@ internal static Type[] GetGenericTypeArguments(this Type source)
138138

139139
internal static IEnumerable<ConstructorInfo> GetConstructors(this Type source)
140140
{
141-
#if NETSTANDARD1_0
141+
#if NETSTANDARD
142142
return source.GetTypeInfo().DeclaredConstructors;
143143
#else
144144
return source.GetConstructors();
@@ -147,7 +147,7 @@ internal static IEnumerable<ConstructorInfo> GetConstructors(this Type source)
147147

148148
internal static MethodInfo GetMethod(this Type source, string name)
149149
{
150-
#if NETSTANDARD1_0
150+
#if NETSTANDARD
151151
return source.GetTypeInfo().GetDeclaredMethod(name);
152152
#else
153153
return source.GetMethod(name);
@@ -156,7 +156,7 @@ internal static MethodInfo GetMethod(this Type source, string name)
156156

157157
internal static string GetModuleName(this Type source)
158158
{
159-
#if NETSTANDARD1_0
159+
#if NETSTANDARD
160160
return source.GetTypeInfo().Module.Name;
161161
#else
162162
return source.Module.ScopeName;
@@ -170,7 +170,7 @@ internal static Type GetTypeInfo(this Type source)
170170
}
171171
#endif
172172

173-
#if NETSTANDARD1_0
173+
#if NETSTANDARD
174174
internal static void ForEach<T>(this IEnumerable<T> source, Action<T> eachItem)
175175
{
176176
foreach (T item in source)

Tynamix.ObjectFiller/Plugins/List/Collectionizer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Tynamix.ObjectFiller
99
/// <typeparam name="T">Typeparameter of of the target List</typeparam>
1010
/// <typeparam name="TRandomizer">Plugin which will be used to create the List</typeparam>
1111
public class Collectionizer<T, TRandomizer> : IRandomizerPlugin<List<T>>, IRandomizerPlugin<T[]>
12-
#if !NETSTANDARD1_0
12+
#if !NETSTANDARD
1313
, IRandomizerPlugin<ArrayList>
1414
#endif
1515
where TRandomizer : IRandomizerPlugin<T>, new()
@@ -120,7 +120,7 @@ T[] IRandomizerPlugin<T[]>.GetValue()
120120
return this.GetValue().ToArray();
121121
}
122122

123-
#if !NETSTANDARD1_0
123+
#if !NETSTANDARD
124124
/// <summary>
125125
/// Gets random data for type <typeparamref name="T"/>
126126
/// </summary>

Tynamix.ObjectFiller/Setup/FillerSetupItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private void SetDefaultRandomizer()
156156
this.TypeToRandomFunc[typeof(TimeSpan)] = () => new TimeSpan(Random.Next());
157157
this.TypeToRandomFunc[typeof(TimeSpan?)] = () => new TimeSpan(Random.Next());
158158
this.TypeToRandomFunc[typeof(Uri)] = () => uriRandomizer.GetValue();
159-
#if !NETSTANDARD1_0
159+
#if !NETSTANDARD
160160
this.TypeToRandomFunc[typeof(ArrayList)] = () => ((IRandomizerPlugin<ArrayList>)new Collectionizer<string, MnemonicString>()).GetValue();
161161
#endif
162162
}

0 commit comments

Comments
 (0)