mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 09:59:48 -05:00
Merge some code clean ups. Find+Replace 'PowerShell' with 'SQL Tools'. Enable logger in ServiceHost project.
34 lines
871 B
C#
34 lines
871 B
C#
//
|
|
// Copyright (c) Microsoft. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
//
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
|
|
{
|
|
/// <summary>
|
|
/// Provides context for a received event so that handlers
|
|
/// can write events back to the channel.
|
|
/// </summary>
|
|
public class EventContext
|
|
{
|
|
private MessageWriter messageWriter;
|
|
|
|
public EventContext(MessageWriter messageWriter)
|
|
{
|
|
this.messageWriter = messageWriter;
|
|
}
|
|
|
|
public async Task SendEvent<TParams>(
|
|
EventType<TParams> eventType,
|
|
TParams eventParams)
|
|
{
|
|
await this.messageWriter.WriteEvent(
|
|
eventType,
|
|
eventParams);
|
|
}
|
|
}
|
|
}
|
|
|