using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Text;
namespace Mesnac.PlugIn.View
{
///
/// 建立所有视图窗口的基础接口
/// 窗体设计器、代码编辑器、对象查看器等窗口的基础接口
///
public interface IViewContent : IDisposable
{
///
/// 标识号
///
string ViewContentID { get; set; }
///
/// 对象所有者
///
object MyOwner { get; set; }
///
/// 视图窗口的标题文本
///
string TitleName { get; set; }
///
/// 是否真是关闭
///
bool IsRealClose { get; set; }
///
/// 可见属性
///
bool Visible { get; set; }
///
/// 返回视图窗口中对应的Windows控件
///
Control Control { get; }
///
/// 视图窗口操作项集合
///
List ActionList { get; }
///
/// 向操作集合中添加一个操作项
///
///
void AddActionItem(ActionItem actionItem);
///
/// 向操作集合中添加一个操作项
///
/// 操作名称
/// 功能控件
void AddActionItem(string actionName, Control control);
///
/// 移除一个控件对应的操作
///
///
void RemoveActionItem(Control control);
///
/// 清空操作集合
///
void ClearActionList();
///
/// 触发重新载入事件
///
/// 事件对象
void TriggerReloadEvent(System.EventArgs e);
///
/// 重绘视图窗口中的所有组件
///
void RedrawContent();
///
/// 标题名称更改时触发的事件
///
event EventHandler TitleNameChanged;
///
/// 重新载入事件
///
event EventHandler Reload;
}
///
/// 操作项类的封装
///
[Serializable]
public class ActionItem
{
private string _actionName;
private Control _control;
public ActionItem() { }
public ActionItem(string actionName, Control control)
{
this._actionName = actionName;
this._control = control;
}
///
/// 操作名称
///
public string ActionName
{
get { return _actionName; }
set { _actionName = value; }
}
///
/// 功能控件
///
public Control Control
{
get { return _control; }
set { _control = value; }
}
}
}