-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
297 additions
and
17 deletions.
There are no files selected for viewing
Empty file.
Empty file.
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,27 @@ | ||
using CourseworkTooling; | ||
|
||
namespace ConfigurationSystem; | ||
public interface IConfig | ||
{ | ||
static string? Path { get; set; } = "config.json"; | ||
|
||
State UpdateConfig() | ||
{ | ||
if(Path is null) | ||
{ | ||
return FlagFailure; | ||
} | ||
|
||
return FileHandler.SerializeWrite(this, Path); | ||
} | ||
|
||
static State GetConfig<T>() | ||
{ | ||
if(Path is null) | ||
{ | ||
return FlagFailure; | ||
} | ||
|
||
return FileHandler.ReadDeserialize<T>(Path); | ||
} | ||
} |
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,9 @@ | ||
namespace ExceptionSystem.ToolingExceptions; | ||
|
||
public class UnwrapException : Exception | ||
{ | ||
public UnwrapException(string message) : base(message) | ||
{ | ||
// Log exception | ||
} | ||
} |
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,8 @@ | ||
namespace CourseworkTooling; | ||
|
||
public static class ActionHelper | ||
{ | ||
public static Action EmptyAction() => () => { }; | ||
public static Action<T1> EmptyAction<T1>() => (_) => { }; | ||
public static Action<T1, T2> EmptyAction<T1, T2>() => (_, _) => { }; | ||
} |
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
Oops, something went wrong.