You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Connected.Components/Services/DialogResult.cs

33 lines
882 B

// Copyright (c) 2020 Jonny Larsson
// License: MIT
// See https://github.com/MudBlazor/MudBlazor
// Modified version of Blazored Modal
// Copyright (c) 2019 Blazored
// License: MIT
// See https://github.com/Blazored
using System;
namespace Connected
{
public class DialogResult
{
public object Data { get; }
public Type DataType { get; }
public bool Cancelled { get; }
protected internal DialogResult(object data, Type resultType, bool cancelled)
{
Data = data;
DataType = resultType;
Cancelled = cancelled;
}
public static DialogResult Ok<T>(T result) => Ok(result, default);
public static DialogResult Ok<T>(T result, Type dialogType) => new(result, dialogType, false);
public static DialogResult Cancel() => new(default, typeof(object), true);
}
}