DepartmentProject/DepartmentPortal/Common/DesktopTools/Controls/BaseControlViewEntityList.cs

69 lines
1.6 KiB
C#
Raw Normal View History

using ModuleTools.Enums;
using System;
using System.Windows.Forms;
namespace DesktopTools.Controls
{
public partial class BaseControlViewEntityList : UserControl
{
/// <summary>
/// Событие, вызываемое при закрытии контрола
/// </summary>
protected event Action<Guid> CloseEvent;
/// <summary>
/// Событие, вызываемое при закрытии контрола
/// </summary>
public event Action<Guid> CloseEventAdd { add { CloseEvent += value; } remove { CloseEvent -= value; } }
/// <summary>
/// Открытие формы
/// </summary>
public virtual void Open() { }
/// <summary>
/// Закрытие формы
/// </summary>
public virtual void Close()
{
CloseEvent?.Invoke(Id);
Dispose();
}
/// <summary>
/// Дубликат контрола
/// </summary>
/// <returns></returns>
public virtual BaseControlViewEntityList Clone() { return null; }
/// <summary>
/// Идентификатор контрола
/// </summary>
public Guid Id { get; protected set; }
/// <summary>
/// Заголовок контрола
/// </summary>
public string Title { get; protected set; }
/// <summary>
/// Порядок контрола в меню
/// </summary>
public int Order { get; protected set; }
/// <summary>
/// Операция в системе
/// </summary>
public AccessOperation AccessOperation { get; protected set; }
/// <summary>
/// Констркутор
/// </summary>
public BaseControlViewEntityList()
{
InitializeComponent();
}
}
}