public ManualResetEventSlim Send(CommandObject command)
 {
     if (!command.Schema.ProcessRuntimeID.HasValue)
     {
         return(Send(PacketMethods.CreatePacket(PacketContents.CommandSchemaWithData, 0, command.ToCommand().ToArray())));
     }
     else
     {
         int schemeRuntimeID;
         lock (m_knownSchemas)
         {
             if (!m_knownSchemas.TryGetValue(command.Schema.ProcessRuntimeID.Value, out schemeRuntimeID))
             {
                 if (command.Schema.ProcessRuntimeID == -1)
                 {
                     throw new Exception("Cannot serialize a schema that has not been defined in this process.");
                 }
                 schemeRuntimeID = m_knownSchemas.Count;
                 m_knownSchemas.Add(command.Schema.ProcessRuntimeID.Value, schemeRuntimeID);
                 Send(command.Schema.ToCommand(schemeRuntimeID));
             }
         }
         return(Send(command.ToDataCommandPacket(schemeRuntimeID)));
     }
 }