// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace AntDesign
{
///
///
///
public abstract class FeedbackRefBase : IFeedbackRef
{
///
///
///
IModalTemplate IFeedbackRef.ModalTemplate { get; set; }
///
public Func OnOpen { get; set; }
///
public Func OnClose { get; set; }
///
/// just open close feedback component
///
///
public abstract Task OpenAsync();
///
public abstract Task UpdateConfigAsync();
///
/// just do close feedback component, and will not trigger OkAsync or OkCancel
///
///
public abstract Task CloseAsync();
}
///
///
///
public abstract class FeedbackRefWithOkCancelBase : FeedbackRefBase, IOkCancelRef
{
///
/// invoke when cancel button or closer click
///
public Func OnCancel { get; set; }
///
/// invoke when Ok button click
///
public Func OnOk { get; set; }
///
/// Ok button click
///
///
public async Task OkAsync(ModalClosingEventArgs e)
{
await CloseAsync();
if (OnOk != null)
{
await OnOk();
}
}
///
/// Cancel button click
///
///
public async Task CancelAsync(ModalClosingEventArgs e)
{
await CloseAsync();
if (OnCancel != null)
{
await OnCancel();
}
}
}
}