public void Send()

in JetBrains.Profiler.SelfApi/src/Impl/ConsoleProfiler.cs [144:176]


    public void Send(string command, params string[] args)
    {
      if (IsApiUsed)
        throw new InvalidOperationException("It is not possible to send commands if profiler API is used");

      var messageBuilder = new StringBuilder();
      messageBuilder.Append(_prefix).Append("[\"").Append(command).Append("\"");

      if (args != null && args.Length > 0)
      {
        messageBuilder.Append(",{");
        for (var i = 0; i < args.Length; i += 2)
        {
          messageBuilder.Append(args[i]).Append(":");

          if (args[i + 1] != null)
            messageBuilder.Append("\"").Append(args[i + 1].Replace('"', '`')).Append("\"");
          else
            messageBuilder.Append("null");

          if (i > 0)
            messageBuilder.Append(",");
        }

        messageBuilder.Append("}");
      }

      messageBuilder.Append("]");

      var message = messageBuilder.ToString();
      Trace.Verbose(message);
      _process.StandardInput.WriteLine(message);
    }