Inheritance: Message
Esempio n. 1
0
 public static Command FromString(string value)
 {
     try
     {
         var s = value.Split('|');
         var result = new Command();
         result.SenderId = int.Parse(s[0]);
         result.SenderName = s[1];
         result.CommandName = s[2];
         result.Data = s[3];
         return result;
     }
     catch (Exception e)
     {
         Console.WriteLine("Error parsing command:" + e.Message);
         return null;
     }
 }
Esempio n. 2
0
 public void TriggerCommand(string name, string data)
 {
     var c = new Command
     {
         CommandName = name,
         Data = data
     };
     if (CommandReceived != null) CommandReceived(this, c);
 }
Esempio n. 3
0
 public void SendCommand(int id, string name, string data)
 {
     var c = new Command
     {
         CommandName = name,
         DateTime = DateTime.Now,
         Data = data,
         SenderId = Id,
         SenderName = Imb.ClientHandle.ToString(CultureInfo.InvariantCulture)
     };
     SendMessage(id + ".Commands", c.ToString());
 }