This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add assembly rotation author feature.
- Loading branch information
1 parent
58a77e2
commit 5b85f81
Showing
5 changed files
with
44 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using RotationSolver.Basic.Rotations; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace RotationSolver; | ||
|
||
internal static class RotationHelper | ||
{ | ||
const string DefaultAssembly = ""; | ||
static readonly string[] _allowedAssembly = new string[] | ||
{ | ||
DefaultAssembly, | ||
}; | ||
|
||
public static bool IsDefault(this ICustomRotation rotation) | ||
=> DefaultAssembly == rotation.GetType().Assembly.FullName; | ||
|
||
public static bool IsAllowed(this ICustomRotation rotation, out string name) | ||
{ | ||
name = rotation.GetType().Assembly.GetName().Name; | ||
return _allowedAssembly.Contains(rotation.GetType().Assembly.FullName); | ||
} | ||
|
||
public static string GetAuthor(this ICustomRotation rotation) | ||
{ | ||
return FileVersionInfo.GetVersionInfo(rotation.GetType().Assembly.Location)?.CompanyName ?? "Unnamed"; | ||
} | ||
} |
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