mirror of
https://github.com/ZetaKebab/MpcNET.git
synced 2025-01-14 22:18:43 +00:00
35 lines
814 B
C#
35 lines
814 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace LibMpc
|
|
{
|
|
public interface IMpdResponse<T>
|
|
{
|
|
IMpdResponseState State { get; }
|
|
T Body { get; }
|
|
}
|
|
|
|
public class MpdResponse<T> : IMpdResponse<T>
|
|
{
|
|
public MpdResponse(string endLine, T body, bool connected)
|
|
{
|
|
State = new MpdResponseState(endLine, connected);
|
|
Body = body;
|
|
}
|
|
|
|
public IMpdResponseState State { get; }
|
|
public T Body { get; }
|
|
}
|
|
|
|
public static class CheckNotNullExtension
|
|
{
|
|
public static void CheckNotNull(this object toBeChecked)
|
|
{
|
|
if (toBeChecked == null)
|
|
{
|
|
throw new ArgumentNullException(nameof(toBeChecked));
|
|
}
|
|
}
|
|
}
|
|
}
|