42 lines
916 B
C#
42 lines
916 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace PlantBox.Shared.Communication.Commands
|
|
{
|
|
public class Ping : CommandSerializable<Ping>
|
|
{
|
|
public string Message { get; set; }
|
|
|
|
public Ping()
|
|
{
|
|
|
|
}
|
|
public Ping(string message)
|
|
{
|
|
Message = message;
|
|
}
|
|
|
|
public override Ping 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 };
|
|
}
|
|
}
|
|
}
|