54 lines
1.5 KiB
C#
54 lines
1.5 KiB
C#
|
using DesktopTools.Interfaces;
|
|||
|
using DesktopTools.Models;
|
|||
|
using ModuleTools.Enums;
|
|||
|
using System;
|
|||
|
using System.Windows.Forms;
|
|||
|
|
|||
|
namespace DesktopTools.Controls
|
|||
|
{
|
|||
|
public partial class MainControlViewEntityList : UserControl, IControl, IControlChildEntity, IControlEntityList, IControlEntitySelectable
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Методы для реализации в generic-контроле
|
|||
|
/// </summary>
|
|||
|
protected IControlViewEntityList _controlViewEntityList;
|
|||
|
|
|||
|
#region IControlEntity
|
|||
|
public Guid ControlId { get; protected set; }
|
|||
|
|
|||
|
public string Title { get; protected set; }
|
|||
|
|
|||
|
public AccessOperation AccessOperation { get; protected set; }
|
|||
|
|
|||
|
public void Open(ControlOpenModel model) => _controlViewEntityList?.OpenControl(model);
|
|||
|
|
|||
|
public IControl GetInstance() => _controlViewEntityList?.GetInstanceControl();
|
|||
|
#endregion
|
|||
|
|
|||
|
#region IControlEntityList
|
|||
|
public IControlChildEntity ControlViewEntityElement { get; protected set; }
|
|||
|
#endregion
|
|||
|
|
|||
|
#region IControlChildEntity
|
|||
|
public string ParentPropertyName { get; set; }
|
|||
|
|
|||
|
public object ParentObject { get; set; }
|
|||
|
|
|||
|
public Guid? ParentId { get; set; }
|
|||
|
#endregion
|
|||
|
|
|||
|
#region ISelectableControlManager
|
|||
|
public Guid? SelectedId { get; protected set; }
|
|||
|
|
|||
|
public string SelectedText { get; protected set; }
|
|||
|
|
|||
|
public string GetTitleFromId(Guid id) => _controlViewEntityList?.GetTitleFromIdControl(id);
|
|||
|
#endregion
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Констркутор
|
|||
|
/// </summary>
|
|||
|
public MainControlViewEntityList() => InitializeComponent();
|
|||
|
}
|
|||
|
}
|