You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
115 lines
2.9 KiB
C#
115 lines
2.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Reflection;
|
|
using Mesnac.Action.Base;
|
|
using Mesnac.Controls.Base;
|
|
|
|
namespace Mesnac.ActionService
|
|
{
|
|
/// <summary>
|
|
/// 设计时功能操作信息
|
|
/// </summary>
|
|
public class DesignAction
|
|
{
|
|
/// <summary>
|
|
/// 保存的唯一值
|
|
/// </summary>
|
|
public string GUID { get; set; }
|
|
/// <summary>
|
|
/// 显示的名称
|
|
/// </summary>
|
|
public string Name { get; set; }
|
|
/// <summary>
|
|
/// 说明
|
|
/// </summary>
|
|
public string Remark { get; set; }
|
|
/// <summary>
|
|
/// 自动运行
|
|
/// </summary>
|
|
public bool AutoRun { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 设计时可用操作列表
|
|
/// </summary>
|
|
public class DesignActionNode
|
|
{
|
|
public DesignActionNode()
|
|
{
|
|
this.Name = string.Empty;
|
|
this.Children = new List<DesignActionNode>();
|
|
this.ActionNode = new List<DesignAction>();
|
|
}
|
|
public string Name { get; set; }
|
|
public List<DesignActionNode> Children { get; set; }
|
|
public List<DesignAction> ActionNode { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 事件处理接口
|
|
/// </summary>
|
|
public interface IDesignService
|
|
{
|
|
void IniDesignAction(string path);
|
|
DesignActionNode DesignActionTree { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 运行时功能操作信息
|
|
/// </summary>
|
|
public class RuntimeAction
|
|
{
|
|
public string GUID { get; set; }
|
|
public bool AutoRun { get; set; }
|
|
public string File { get; set; }
|
|
public Assembly Assembly { get; set; }
|
|
public Type Class { get; set; }
|
|
public IAction Instance { get; set; }
|
|
}
|
|
|
|
|
|
public class DesignRuntime
|
|
{
|
|
public DesignRuntime(string guid)
|
|
{
|
|
this.GUID = guid;
|
|
this.Parameters = string.Empty;
|
|
}
|
|
public DesignRuntime(string guid, string parameters)
|
|
{
|
|
this.GUID = guid;
|
|
this.Parameters = parameters;
|
|
}
|
|
public string GUID { get; set; }
|
|
public string Parameters { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 运行时功能操作信息
|
|
/// </summary>
|
|
public class DesignToRuntime
|
|
{
|
|
public DesignToRuntime()
|
|
{
|
|
this.GUID = string.Empty;
|
|
this.Runtime = new List<DesignRuntime>();
|
|
}
|
|
public string GUID { get; set; }
|
|
public List<DesignRuntime> Runtime { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 事件处理接口
|
|
/// </summary>
|
|
public interface IRuntimeService
|
|
{
|
|
void IniRuntimeAction(string path, bool isAutoRun);
|
|
void Run(object sender, List<string> action);
|
|
Dictionary<string, RuntimeAction> AllRuntimeAction { get; set; }
|
|
Dictionary<string, DesignToRuntime> AllDesignToRuntime { get; set; }
|
|
}
|
|
|
|
}
|