public Task ShowMessageAsync(string message, TraceEventType eventType)
        {
            var parameters = new ShowMessageRequestParams {
                type    = eventType.ToMessageType(),
                message = message
            };

            return(_clientApp.NotifyWithParameterObjectAsync("window/showMessage", parameters));
        }
Example #2
0
        public Task LogMessageAsync(string message, TraceEventType eventType)
        {
            if (eventType > LogLevel && eventType != TraceEventType.Information)
            {
                return(Task.CompletedTask);
            }
            var parameters = new LogMessageParams {
                type    = eventType.ToMessageType(),
                message = message
            };

            return(_clientApp.NotifyWithParameterObjectAsync("window/logMessage", parameters));
        }
        public async Task <string> ShowMessageAsync(string message, string[] actions, TraceEventType eventType)
        {
            var parameters = new ShowMessageRequestParams {
                type    = eventType.ToMessageType(),
                message = message,
                actions = actions.Select(a => new MessageActionItem {
                    title = a
                }).ToArray()
            };
            var result = await _clientApp.InvokeWithParameterObjectAsync <MessageActionItem>("window/showMessageRequest", parameters);

            return(result?.title);
        }