2025-02-23 10:18:38 +03:00
|
|
|
using System;
|
2025-02-20 16:10:09 +03:00
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
2025-07-10 18:58:49 +03:00
|
|
|
using mROA.Abstract;
|
2025-02-05 18:04:35 +03:00
|
|
|
using mROA.Implementation;
|
2025-02-07 16:53:12 +03:00
|
|
|
using mROA.Implementation.Attributes;
|
2025-02-05 18:04:35 +03:00
|
|
|
|
2025-02-20 16:10:09 +03:00
|
|
|
namespace Example.Shared
|
2025-02-05 18:04:35 +03:00
|
|
|
{
|
2025-02-20 16:10:09 +03:00
|
|
|
[SharedObjectInterface]
|
2025-03-10 00:00:24 +03:00
|
|
|
public partial interface IPrinter : IDisposable, IShared
|
2025-02-20 16:10:09 +03:00
|
|
|
{
|
2025-03-08 23:22:59 +03:00
|
|
|
double Resource { get; set; }
|
2025-02-20 16:10:09 +03:00
|
|
|
string GetName();
|
2025-03-10 00:00:24 +03:00
|
|
|
Task<IPage> Print(string text, bool someParameter, RequestContext context, CancellationToken cancellationToken);
|
2025-03-11 19:42:10 +03:00
|
|
|
event Action<IPage, RequestContext> OnPrint;
|
2025-06-03 12:09:32 +03:00
|
|
|
|
2025-05-03 21:43:02 +03:00
|
|
|
[Untrusted]
|
|
|
|
|
Task SomeoneIsApproaching(string humanName);
|
2025-06-03 12:09:32 +03:00
|
|
|
|
2025-05-14 12:58:14 +03:00
|
|
|
Task SetFingerPrint(int[] fingerPrint);
|
2025-06-03 12:09:32 +03:00
|
|
|
Task IntTest(MyData data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class MyData
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
public double Score { get; set; }
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return $"{{{nameof(Id)}: {Id}, {nameof(Name)}: {Name}, {nameof(Score)}: {Score}}}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected bool Equals(MyData other)
|
|
|
|
|
{
|
|
|
|
|
return Id == other.Id && Name == other.Name && Score.Equals(other.Score);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
{
|
|
|
|
|
if (obj is null) return false;
|
|
|
|
|
if (ReferenceEquals(this, obj)) return true;
|
|
|
|
|
if (obj.GetType() != GetType()) return false;
|
|
|
|
|
return Equals((MyData)obj);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return HashCode.Combine(Id, Name, Score);
|
|
|
|
|
}
|
2025-02-20 16:10:09 +03:00
|
|
|
}
|
2025-02-05 18:04:35 +03:00
|
|
|
}
|