mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-04-29 06:48:41 +00:00
dist
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using Esiur.Resource;
|
||||
|
||||
/// <summary>
|
||||
/// A simple observable sensor resource.
|
||||
/// Property changes are automatically propagated to all attached peers.
|
||||
/// </summary>
|
||||
[Resource]
|
||||
public class SensorResource : Resource
|
||||
{
|
||||
public int SensorId { get; set; }
|
||||
|
||||
private double _value;
|
||||
|
||||
[ResourceProperty]
|
||||
public double Value
|
||||
{
|
||||
get => _value;
|
||||
set
|
||||
{
|
||||
_value = value;
|
||||
PropertyModified("Value"); // notifies Esiur runtime to propagate
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user