Added support for auto enum casting

- counted up version number
- cleaned up register constructors that are used inernally only
This commit is contained in:
Felix Weiß
2022-06-24 11:25:26 +02:00
parent 83f17a4eae
commit e953938a65
7 changed files with 69 additions and 12 deletions

View File

@@ -30,12 +30,7 @@ namespace Examples {
//reading a value from the register collection
Console.WriteLine($"BitValue is: {registers.BitValue}");
interf.GetRegister(nameof(registers.TestBool1)).PropertyChanged += (s, e) => {
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine(interf.GetRegister(nameof(registers.TestBool1)).StringValue);
Console.ResetColor();
};
Console.WriteLine($"TestEnum is: {registers.TestEnum}");
//writing a value to the registers
Task.Factory.StartNew(async () => {

View File

@@ -50,5 +50,21 @@ namespace Examples {
[Register(7012)]
public TimeSpan TestTime { get; private set; }
public enum CurrentState {
Undefined = 0,
State1 = 1,
State2 = 2,
//State3 = 3,
State4 = 4,
State5 = 5,
StateBetween = 100,
State6 = 6,
State7 = 7,
}
[Register(50)]
public CurrentState TestEnum { get; private set; }
}
}