You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.8 KiB
C#

9 months ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NLog;
namespace JwKdsV
{
public partial class AbstractFlyoutPanelEx : UserControl
{
protected Logger logger = null;
public AbstractFlyoutPanelEx()
{
InitializeComponent();
logger = NLog.LogManager.GetLogger(GetType().FullName);
}
public event FlyoutEventHandler AcceptButtonClick;
public virtual void OnAcceptButtonClick(FlyoutEventArgs e)
{
AcceptButtonClick?.Invoke(this, e);
}
public event FlyoutEventHandler CancelButtonClick;
public virtual void OnCancelButtonClick(FlyoutEventArgs e)
{
CancelButtonClick?.Invoke(this, e);
}
public event FlyoutEventHandler NotifyChanged;
public virtual void OnNotifyChanged(FlyoutEventArgs e)
{
NotifyChanged?.Invoke(this, e);
}
public virtual void CloseFlyout()
{
}
}
public delegate void FlyoutEventHandler(object sender, FlyoutEventArgs e);
public enum FlyoutAction
{
None = 0,
Cancel = 1,
Accept = 2,
Replace = 3,
Notify = 4
}
public class FlyoutEventArgs : EventArgs
{
public readonly FlyoutAction Action;
public readonly string KeyCode;
public readonly object Data;
public FlyoutEventArgs(FlyoutAction action, string keyCode, object data)
{
this.KeyCode = keyCode;
this.Data = data;
this.Action = action;
}
public FlyoutEventArgs(FlyoutAction action, object data) : this(action, "", data)
{
}
}
}