-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from koculu/81-enhancement-type-validation-sho…
…uld-not-fail-based-on-the-version-of-the-assembly-difference 81 enhancement type validation should not fail based on the version of the assembly difference
- Loading branch information
Showing
17 changed files
with
95 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System.Text; | ||
|
||
namespace Tenray.ZoneTree.Core; | ||
|
||
public static class TypeExtensions | ||
{ | ||
public static string SimplifiedFullName(this Type type) | ||
{ | ||
if (!type.IsGenericType) | ||
return type.FullName; | ||
var builder = new StringBuilder(); | ||
var typeName = type.Namespace + "." + type.Name; | ||
int index = typeName.IndexOf('`'); | ||
Check warning on line 13 in src/ZoneTree/Core/TypeExtensions.cs GitHub Actions / build
|
||
if (index > 0) | ||
{ | ||
builder.Append(typeName.Substring(0, index)); | ||
} | ||
else | ||
{ | ||
builder.Append(typeName); | ||
} | ||
|
||
builder.Append("<"); | ||
Check warning on line 23 in src/ZoneTree/Core/TypeExtensions.cs GitHub Actions / build
|
||
var genericArguments = type.GetGenericArguments(); | ||
var len = genericArguments.Length; | ||
for (var i = 0; i < len; i++) | ||
{ | ||
if (i > 0) | ||
{ | ||
builder.Append(", "); | ||
} | ||
builder.Append(genericArguments[i].SimplifiedFullName()); | ||
} | ||
builder.Append(">"); | ||
Check warning on line 34 in src/ZoneTree/Core/TypeExtensions.cs GitHub Actions / build
|
||
return builder.ToString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.