mirror of
https://github.com/evopro-ag/Sharp7Reactive.git
synced 2025-12-16 11:42:52 +00:00
Move ToArea to extension method
This commit is contained in:
17
Sharp7.Rx/Extensions/OperandExtensions.cs
Normal file
17
Sharp7.Rx/Extensions/OperandExtensions.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Sharp7.Rx.Enums;
|
||||
|
||||
namespace Sharp7.Rx.Extensions;
|
||||
|
||||
internal static class OperandExtensions
|
||||
{
|
||||
public static S7Area ToArea(this Operand operand) =>
|
||||
operand switch
|
||||
{
|
||||
Operand.Input => S7Area.PE,
|
||||
Operand.Output => S7Area.PA,
|
||||
Operand.Marker => S7Area.MK,
|
||||
Operand.Db => S7Area.DB,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(operand), operand, null)
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user