XKRS2023Frm/XKRS.UI.Model.Winform/UI/DockContent/MenuFrmBase.cs
2023-03-24 17:02:04 +08:00

65 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using XKRS.Common.Interface;
namespace XKRS.UI.Model.Winform
{
public partial class MenuFormBase : DockContent
{
public Action<string,IProcess> OnUploadProcess { get; set; }
public event Action<bool> OnIsLoginChanged;
public string Id { get; set; } = Guid.NewGuid().ToString();
private IProcess process = null;
public IProcess Process
{
get => process;
set
{
if (process != value)
{
process = value;
OnProcessUpdated();
}
}
}
public MenuFormBase()
{
InitializeComponent();
}
#region IProcessObserver
public virtual void OnProcessUpdated() { }
public virtual void DownloadProcess(IProcess process)
{
Process = process;
}
#endregion
#region Login
protected virtual bool IsLogin { get; set; }
public virtual void SetLoginStatus(bool isLogin)
{
IsLogin = isLogin;
OnIsLoginChanged?.Invoke(IsLogin);
}
#endregion
}
}