Rename Ping to PingCommand

This commit is contained in:
2019-03-23 21:47:26 +01:00
parent 6b7ee73597
commit 1c49b5150a

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace PlantBox.Shared.Communication.Commands
{
public class PingCommand : CommandSerializable<PingCommand>
{
public string Message { get; set; }
public PingCommand()
{
}
public PingCommand(string message)
{
Message = message;
}
public override PingCommand Deserialize(string[] arguments)
{
if (arguments == null)
{
throw new ArgumentNullException(nameof(arguments));
}
if (arguments.Length < 1)
{
throw new ArgumentException($"Excepted at least 1 argument, got {arguments.Length}");
}
Message = arguments[0];
return this;
}
public override string[] Serialize()
{
return new string[] { Message };
}
}
}