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.
68 lines
1.6 KiB
C#
68 lines
1.6 KiB
C#
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 POSV
|
|
{
|
|
[ToolboxItem(false)]
|
|
public partial class AbstractNotifyPanelEx : BaseUserControl
|
|
{
|
|
protected Logger logger = null;
|
|
|
|
public AbstractNotifyPanelEx()
|
|
{
|
|
InitializeComponent();
|
|
|
|
logger = NLog.LogManager.GetLogger(GetType().FullName);
|
|
}
|
|
|
|
public event NofityEventHandler ButtonClick;
|
|
public virtual void OnButtonClick(NotifyEventArgs e)
|
|
{
|
|
ButtonClick?.Invoke(this , e);
|
|
}
|
|
|
|
public event NofityEventHandler NotifyChanged;
|
|
public virtual void OnNotifyChanged(NotifyEventArgs e)
|
|
{
|
|
NotifyChanged?.Invoke(this , e);
|
|
}
|
|
}
|
|
|
|
public delegate void NofityEventHandler(object sender , NotifyEventArgs e);
|
|
|
|
public enum NotifyAction
|
|
{
|
|
None = 0,
|
|
Cancel = 1,
|
|
Accept = 2,
|
|
Replace = 3,
|
|
Notify = 4,
|
|
OK = 5
|
|
}
|
|
|
|
public class NotifyEventArgs : EventArgs
|
|
{
|
|
public readonly NotifyAction Action;
|
|
public readonly string KeyCode;
|
|
public readonly object Data;
|
|
public NotifyEventArgs(NotifyAction action , string keyCode , object data)
|
|
{
|
|
this.KeyCode = keyCode;
|
|
this.Data = data;
|
|
this.Action = action;
|
|
}
|
|
|
|
public NotifyEventArgs(NotifyAction action , object data) : this(action , "" , data)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|