Добавлена поддержка нескольких параметров в кодген
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Example.Shared;
|
||||
|
||||
@@ -5,7 +6,6 @@ namespace Example.Backend
|
||||
{
|
||||
public class PagesList : IPagesList
|
||||
{
|
||||
public IReadOnlyList<IPage> Collection { get; }
|
||||
public IPage Get(int index)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
@@ -16,9 +16,17 @@ namespace Example.Backend
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void Set(int index, IPage item)
|
||||
public void Remove(int index, IPage item)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public event Action<IPage>? OnAdd;
|
||||
public event Action<IPage>? OnRemove;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// TODO release managed resources here
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,20 +9,26 @@ namespace Example.Backend
|
||||
public class Printer : IPrinter
|
||||
{
|
||||
public string Name;
|
||||
|
||||
public string GetName()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
public async Task<IPage> Print(string text, CancellationToken cancellationToken = default)
|
||||
public async Task<IPage> Print(string text, bool some, CancellationToken cancellationToken = default)
|
||||
{
|
||||
// throw new Exception("The method or operation is not implemented.");
|
||||
return new Page {Text = text};
|
||||
var page = new Page { Text = text };
|
||||
OnPrint?.Invoke(page);
|
||||
return page;
|
||||
}
|
||||
|
||||
public event Action<IPage>? OnPrint;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Console.WriteLine("Dispose printer with name {0}, Dispose works, Dispose works, Dispose works, Dispose works,", Name);
|
||||
Console.WriteLine(
|
||||
"Dispose printer with name {0}, Dispose works, Dispose works, Dispose works, Dispose works,", Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user