202303241701Change
This commit is contained in:
@ -15,10 +15,21 @@ namespace XKRS.UI.Model.Winform
|
||||
public partial class DeviceRunFrmBase : DockContent
|
||||
{
|
||||
public IDevice Device { get; set; }
|
||||
public IRunCtrl RunCtrl { get; set; }
|
||||
|
||||
public DeviceRunFrmBase()
|
||||
public DeviceRunFrmBase() : base()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public DeviceRunFrmBase(IDevice device,IRunCtrl runCtrl) : base()
|
||||
{
|
||||
Device = device;
|
||||
RunCtrl = runCtrl;
|
||||
UserControl uc = RunCtrl as UserControl;
|
||||
uc.Dock = DockStyle.Fill;
|
||||
this.Controls.Add(uc);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
namespace XKRS.UI.Model.Winform
|
||||
{
|
||||
partial class MenuFrmBase
|
||||
partial class MenuFormBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
@ -31,13 +31,13 @@ namespace XKRS.UI.Model.Winform
|
||||
{
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// MenuFrmBase
|
||||
// MenuFormBase
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
|
||||
this.ClientSize = new System.Drawing.Size(474, 344);
|
||||
this.DoubleBuffered = true;
|
||||
this.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World);
|
||||
this.Name = "MenuFrmBase";
|
||||
this.Name = "MenuFormBase";
|
||||
this.Text = "MenuFrmBase";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
|
@ -12,24 +12,52 @@ using XKRS.Common.Interface;
|
||||
|
||||
namespace XKRS.UI.Model.Winform
|
||||
{
|
||||
public partial class MenuFrmBase : DockContent
|
||||
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();
|
||||
|
||||
public MenuFrmBase()
|
||||
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
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user