1
0
mirror of https://github.com/ZetaKebab/MpcNET.git synced 2024-09-16 05:30:09 +00:00
MpcNET/LibMpc/Message/MpdResponse.cs

35 lines
852 B
C#
Raw Normal View History

2016-12-06 11:53:49 +00:00
using System;
using System.Collections.Generic;
namespace LibMpc
{
public interface IMpdResponse<T>
2016-12-06 11:53:49 +00:00
{
IMpdResponseState State { get; }
IDictionary<string, T> Body { get; }
2016-12-06 11:53:49 +00:00
}
public class MpdResponse<T> : IMpdResponse<T>
2016-12-06 11:53:49 +00:00
{
public MpdResponse(string endLine, IDictionary<string, T> body, bool connected)
2016-12-06 11:53:49 +00:00
{
State = new MpdResponseState(endLine, connected);
Body = body;
2016-12-06 11:53:49 +00:00
}
public IMpdResponseState State { get; }
public IDictionary<string, T> Body { get; }
2016-12-06 11:53:49 +00:00
}
public static class CheckNotNullExtension
{
public static void CheckNotNull(this object toBeChecked)
{
if (toBeChecked == null)
{
throw new ArgumentNullException(nameof(toBeChecked));
}
}
}
}