2025-07-28 19:59:35 +09:00
|
|
|
#nullable enable
|
|
|
|
|
namespace UVC.UI.Commands
|
2025-06-11 19:24:08 +09:00
|
|
|
{
|
|
|
|
|
public interface ICommand
|
|
|
|
|
{
|
2025-07-28 19:59:35 +09:00
|
|
|
void Execute(object? parameter = null);
|
2025-06-16 19:30:01 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface ICommand<T> : ICommand
|
|
|
|
|
{
|
|
|
|
|
void Execute(T parameter);
|
|
|
|
|
|
2025-07-28 19:59:35 +09:00
|
|
|
void Execute()
|
|
|
|
|
{
|
|
|
|
|
// CS8604: T가 참조형이고 null이 허용되지 않을 때 경고가 발생하므로,
|
|
|
|
|
// T가 null 허용 타입이거나 값 타입일 때만 default(T)를 전달합니다.
|
|
|
|
|
// 그렇지 않으면, 명시적으로 default(T)를 전달하되, T가 null 허용 타입임을 명시합니다.
|
|
|
|
|
Execute(default(T)!);
|
|
|
|
|
}
|
2025-06-11 19:24:08 +09:00
|
|
|
}
|
|
|
|
|
}
|