Files
sqltoolsservice/ServiceHost/MessageProtocol/EventContext.cs
Karl Burtram c78292a680 Servicehost cleanup (#1)
Merge some code clean ups.  Find+Replace 'PowerShell' with 'SQL Tools'.
Enable logger in ServiceHost project.
2016-07-15 20:48:31 -07:00

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);
}
}
}