mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-05-06 03:32:57 +00:00
41 lines
890 B
C#
41 lines
890 B
C#
using Esiur.Net.IIP;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Esiur.Core
|
|
{
|
|
public class InvocationContext
|
|
{
|
|
private uint CallbackId;
|
|
|
|
internal bool Ended;
|
|
|
|
public void Chunk(object value)
|
|
{
|
|
if (Ended)
|
|
throw new Exception("Execution has ended.");
|
|
|
|
Connection.SendChunk(CallbackId, value);
|
|
}
|
|
|
|
public void Progress(int value, int max) {
|
|
|
|
if (Ended)
|
|
throw new Exception("Execution has ended.");
|
|
|
|
Connection.SendProgress(CallbackId, value, max);
|
|
}
|
|
|
|
public DistributedConnection Connection { get; internal set; }
|
|
|
|
|
|
internal InvocationContext(DistributedConnection connection, uint callbackId)
|
|
{
|
|
Connection = connection;
|
|
CallbackId = callbackId;
|
|
|
|
}
|
|
}
|
|
}
|