2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 05:23:13 +00:00

Resource Proxy

This commit is contained in:
2019-07-23 06:22:24 +03:00
parent 2d9f61c0d9
commit a2f4238933
12 changed files with 238 additions and 23 deletions

View File

@ -9,14 +9,14 @@ using System.Threading;
namespace Test
{
class MyObject : Resource
public class MyObject : Resource
{
[ResourceEvent]
public event ResourceEventHanlder LevelUp;
[ResourceEvent]
public event ResourceEventHanlder LevelDown;
public MyObject()
{
Info = new Structure();
@ -27,7 +27,7 @@ namespace Test
Level = 5;
}
[ResourceFunction]
public int Add(int value)
{
@ -113,6 +113,7 @@ namespace Test
}
}
/*
int level;
[ResourceProperty]
public int Level
@ -124,6 +125,21 @@ namespace Test
Instance?.Modified();
}
}
*/
[ResourceProperty]
public virtual int Level
{
get;
set;
}
[ResourceProperty]
public int Level3
{
get => 0;
set => Instance?.Modified();
}
}