2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 05:23:13 +00:00
This commit is contained in:
2024-06-09 20:42:25 +03:00
parent 62617f2c30
commit 08410de9c3
10 changed files with 811 additions and 7 deletions

View File

@ -1,4 +1,5 @@
using Esiur.Resource;
using Esiur.Data;
using Esiur.Resource;
using System;
using System.Collections.Generic;
using System.Linq;
@ -11,8 +12,37 @@ namespace Esiur.Examples.StandaloneWebServerDemo
[Resource]
public partial class Demo
{
[Export] int age { get; set; }
[Export] string name { get; set;}
[Export]
[Export] int color { get; set; }
[Export] string label { get; set;}
[Export] public ResourceEventHandler<int> Cleared;
[Export] public ResourceEventHandler<Point> Drawn;
[Export] List<List<int>> points;
[Export] public void Draw(int x, int y, int color)
{
Drawn?.Invoke(new Point() { X = x, Y = y, Color = color });
}
public Demo()
{
points = new List<List<int>>();
for (var x = 0; x < 400; x++)
{
var p = new List<int>();
points.Add(p);
for (var y = 0; y < 300; y++)
p.Add(0);
}
}
}
[Export]
public class Point : IRecord
{
public int X { get; set; }
public int Y { get; set; }
public int Color { get; set; }
}
}