本文整理汇总了C#中CloseReason类的典型用法代码示例。如果您正苦于以下问题:C# CloseReason类的具体用法?C# CloseReason怎么用?C# CloseReason使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CloseReason类属于命名空间,在下文中一共展示了CloseReason类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CloseAsync
public async Task CloseAsync(PartitionContext context, CloseReason reason)
{
if (reason == CloseReason.Shutdown)
{
await context.CheckpointAsync();
}
}
示例2: socketServer_SessionClosed
void socketServer_SessionClosed(WebSocketSession session, CloseReason reason)
{
if (reason == CloseReason.ServerShutdown)
return;
SendToAll("System: " + session.Cookies["name"] + " disconnected");
}
示例3: secureSocketServer_SessionClosed
void secureSocketServer_SessionClosed(WebSocketSession session, CloseReason reason)
{
lock (m_SecureSessionSyncRoot)
{
m_SecureSessions.Remove(session);
}
}
示例4: RiseOnCloseRequired
protected void RiseOnCloseRequired(CloseReason reason)
{
if (OnCloseRequired != null)
{
OnCloseRequired(this, new CloseEventArgs(reason));
}
}
示例5:
async Task IEventProcessor.CloseAsync(PartitionContext context, CloseReason reason)
{
if (reason == CloseReason.Shutdown)
{
await context.CheckpointAsync();
}
}
示例6: CloseAsync
public async Task CloseAsync(PartitionContext context, CloseReason reason)
{
_log.InfoEvent("Close",
new Facet("reason", reason),
new Facet("partitionId", context.Lease.PartitionId),
new Facet("offset", context.Lease.Offset));
}
示例7: Hide
public void Hide(CloseReason reason)
{
Dispose();
OnClosingEvent(this, reason);
Window.Current.Activated -= OnWindowActivated;//stop listening to app activation
Canvas.SetLeft(flyoutPopup, Window.Current.Bounds.Width);//move it out of the screen
}
示例8: CloseAsync
/// <summary>
/// Closes the event processor partition.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="reason">The reason.</param>
public Task CloseAsync(PartitionContext context, CloseReason reason)
{
Logger.Information("Stopping partition {Partition} processing. Reason: {Reason}", context.Lease.PartitionId, reason);
_targetBlock.Complete();
_statLogger.Dispose();
return Task.FromResult(true);
}
示例9: CloseAsync
public async Task CloseAsync(PartitionContext context, CloseReason reason)
{
Trace.TraceInformation(string.Format("EventProcessor Shuting Down. Partition '{0}', Reason: '{1}'.", this.partitionContext.Lease.PartitionId, reason.ToString()));
if (reason == CloseReason.Shutdown)
{
await context.CheckpointAsync();
}
}
示例10: CloseAsync
public async Task CloseAsync(PartitionContext context, CloseReason reason)
{
Console.WriteLine("Shutting Down Event Processor");
if (reason == CloseReason.Shutdown)
{
await context.CheckpointAsync();
}
}
示例11: CloseAsync
public async Task CloseAsync(PartitionContext context, CloseReason reason)
{
Console.WriteLine($"Processor Shutting Down. Partition '{context.Lease.PartitionId}', Reason: '{reason}'.");
if (reason == CloseReason.Shutdown)
{
await context.CheckpointAsync();
}
}
示例12: appServer_SessionClosed
static void appServer_SessionClosed(WebSocketSession session, CloseReason closeRs)
{
session.Close();
Console.WriteLine("客户端" + session.RemoteEndPoint.Port + "断开了连接!");
ClientNum -= 1;
Console.WriteLine("客户端数目" + ClientNum.ToString());
}
示例13: OnClose
/// <summary>
/// Called when [close].
/// </summary>
protected virtual void OnClose(CloseReason reason)
{
var closedHandler = Closed;
if (closedHandler != null)
{
closedHandler(this, reason);
}
}
示例14: CloseAsync
public async Task CloseAsync(PartitionContext context, CloseReason reason)
{
if (reason == CloseReason.Shutdown)
{
Clients.All.showMessageOnClient("XClose");
await context.CheckpointAsync();
}
}
示例15: CloseAsync
public Task CloseAsync(PartitionContext context, CloseReason reason)
{
if (reason == CloseReason.Shutdown)
{
return context.CheckpointAsync();
}
return Task.FromResult(false);
}