// // 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; using Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.Contracts; namespace Microsoft.SqlTools.ServiceLayer.Hosting.Protocol { /// /// Provides context for a received event so that handlers /// can write events back to the channel. /// public class EventContext { private MessageWriter messageWriter; public EventContext(MessageWriter messageWriter) { this.messageWriter = messageWriter; } public async Task SendEvent( EventType eventType, TParams eventParams) { await this.messageWriter.WriteEvent( eventType, eventParams); } } }