2022-03-18 22:48:14 +04:00
|
|
|
|
using ToolsDesktop.Interfaces;
|
|
|
|
|
using ToolsDesktop.Models;
|
2022-03-18 22:38:52 +04:00
|
|
|
|
using ToolsModule.Enums;
|
2021-04-01 21:30:29 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
2022-03-18 22:48:14 +04:00
|
|
|
|
namespace ToolsDesktop.Controls
|
2021-04-01 21:30:29 +04:00
|
|
|
|
{
|
2022-03-18 12:47:34 +04:00
|
|
|
|
public partial class MainControlViewEntityElement : UserControl, IControl, IControlChildEntity
|
2021-04-01 21:30:29 +04:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Методы для реализации в generic-контроле
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected IControlViewEntityElement _controlViewEntityElement;
|
|
|
|
|
|
|
|
|
|
#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) => _controlViewEntityElement?.OpenControl(model);
|
|
|
|
|
|
|
|
|
|
public IControl GetInstance() => _controlViewEntityElement?.GetInstanceControl();
|
|
|
|
|
|
2021-04-02 09:29:09 +04:00
|
|
|
|
public string SaveToXml() => _controlViewEntityElement?.SaveControlToXml();
|
|
|
|
|
|
|
|
|
|
public void LoadFromXml(string xml) => _controlViewEntityElement?.LoadControlFromXml(xml);
|
|
|
|
|
|
2021-04-01 21:30:29 +04:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region IControlChildEntity
|
|
|
|
|
public string ParentPropertyName { get; set; }
|
|
|
|
|
|
|
|
|
|
public Guid? ParentId { get; set; }
|
|
|
|
|
|
|
|
|
|
public object ParentObject { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Констркутор
|
|
|
|
|
/// </summary>
|
|
|
|
|
public MainControlViewEntityElement() => InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
}
|