Esempio n. 1
0
        private Task SendMessageInternal(
            string name, byte[] content,
            IpcBusContentType type,
            bool restoreWindow = true)
        {
            var message = WrapMessage(
                name, content, type,
                restoreWindow);

            if (message == null || message.Length == 0)
            {
                return(Task.CompletedTask);
            }

            LogManager.Debug.Info($"Send message - name = {name}, " +
                                  $"type = {type}, restoreWindow = {restoreWindow}");

            if (type == IpcBusContentType.StringUtf8)
            {
                LogManager.Debug.Info($"Send message content - " +
                                      $"{Encoding.UTF8.GetString(content)}");
            }

            return(LocalBus.PublishAsync(
                       message));
        }