using HMI.Core.Api;
|
using HMI.UI;
|
using log4net;
|
using System;
|
using System.ComponentModel;
|
using System.Windows;
|
using System.Windows.Controls;
|
|
namespace HMI.Base
|
{
|
/// <summary>
|
/// PluginMaskControl.xaml 的交互逻辑
|
/// </summary>
|
public partial class SimpleMaskControl : UserControl, IPlugin
|
{
|
static SimpleMaskControl()
|
{
|
DefaultStyleKeyProperty.OverrideMetadata(typeof(SimpleMaskControl),
|
new FrameworkPropertyMetadata(typeof(SimpleMaskControl)));
|
}
|
|
protected ILog log;
|
protected string BaseFolder;
|
|
public virtual void Active()
|
{
|
|
}
|
|
public virtual void DeActive()
|
{
|
|
}
|
|
public virtual void Init()
|
{
|
|
}
|
|
public virtual void OnTabChange(object sender, object args)
|
{
|
|
}
|
|
public virtual void SetBaseFolder(string folder)
|
{
|
BaseFolder = folder;
|
}
|
|
public virtual void SetLogger(ILog logger)
|
{
|
log = logger;
|
}
|
|
public virtual void InitFinish()
|
{
|
|
}
|
|
public virtual void OnClose(object sender, CancelEventArgs e)
|
{
|
|
}
|
|
public virtual void DoClose(object sender, EventArgs e)
|
{
|
|
}
|
|
public void ShowMask(Action action, Action<Exception> reject = null, string title = null, string content = null)
|
{
|
MaskControl mask = this.Template.FindName("mask", this) as MaskControl;
|
if (mask != null)
|
{
|
mask.ShowMask(this, action, reject, title, content);
|
}
|
}
|
|
public virtual bool CanActive()
|
{
|
return true;
|
}
|
|
public virtual bool CanDeActive()
|
{
|
return true;
|
}
|
}
|
}
|