Posted on 2007-01-28 10:59
张冰 阅读(140)
评论(1) 编辑 收藏 网摘 所属分类:
基础框架平台
工作台接口是基础管理框架的核心接口.
其主要功能是
1,工作台包含的属性
定义工作空间的工程标题,工作布局管理器获取和设置方法;视图对象集合,面板对象集合,工作台窗体对象集合,当前活动工作台窗体对象,当前活动视图对象的获取等属性;
2,方法
定义工作空间显示视图,显示面板,获取面板,关闭特定视图,关闭全部视图,重绘所有组件
3,事件
定义在工作空间中视图打开后,视图关闭后,活动工作台窗体变化后三个事件,以满足视图内容的修改保存,序列化的需求.
1
using System;
2
using System.Collections.Generic;
3
using System.Text;
4
using MetaApplication.ContentInterfaces;
5
6
namespace MetaApplication
7

{
8
/**//// <summary>
9
/// This is the basic interface to the workspace.
10
/// </summary>
11
public interface IWorkbench : IMementoCapable
12
{
13
/**//// <summary>
14
/// The title shown in the title bar.
15
/// </summary>
16
string Title
17
{
18
get;
19
set;
20
}
21
22
/**//// <summary>
23
/// A collection in which all active workspace windows are saved.
24
/// </summary>
25
List<IViewContent> ViewContentCollection
26
{
27
get;
28
}
29
30
/**//// <summary>
31
/// A collection in which all active workspace windows are saved.
32
/// </summary>
33
List<IPadContent> PadContentCollection
34
{
35
get;
36
}
37
38
/**//// <summary>
39
/// The active workbench window.
40
/// </summary>
41
IWorkbenchWindow ActiveWorkbenchWindow
42
{
43
get;
44
}
45
46
object ActiveContent
47
{
48
get;
49
}
50
51
IWorkbenchLayout WorkbenchLayout
52
{
53
get;
54
set;
55
}
56
57
/**//// <summary>
58
/// Inserts a new <see cref="IViewContent"/> object in the workspace.
59
/// </summary>
60
void ShowView(IViewContent content);
61
62
/**//// <summary>
63
/// Inserts a new <see cref="IPadContent"/> object in the workspace.
64
/// </summary>
65
void ShowPad(IPadContent content);
66
67
/**//// <summary>
68
/// Returns a pad from a specific type.
69
/// </summary>
70
IPadContent GetPad(Type type);
71
72
/**//// <summary>
73
/// Closes the IViewContent content when content is open.
74
/// </summary>
75
void CloseContent(IViewContent content);
76
77
/**//// <summary>
78
/// Closes all views inside the workbench.
79
/// </summary>
80
void CloseAllViews();
81
82
/**//// <summary>
83
/// Re-initializes all components of the workbench, should be called
84
/// when a special property is changed that affects layout stuff.
85
/// (like language change)
86
/// </summary>
87
void RedrawAllComponents();
88
89
/**//// <summary>
90
/// Is called, when a workbench view was opened
91
/// </summary>
92
/// <example>
93
/// WorkbenchSingleton.WorkbenchCreated += delegate {
94
/// WorkbenchSingleton.Workbench.ViewOpened +=
;
95
/// };
96
/// </example>
97
event EventHandler ViewOpened;
98
99
/**//// <summary>
100
/// Is called, when a workbench view was closed
101
/// </summary>
102
event EventHandler ViewClosed;
103
104
/**//// <summary>
105
/// Is called, when the workbench window which the user has into
106
/// the foreground (e.g. editable) changed to a new one.
107
/// </summary>
108
event EventHandler ActiveWorkbenchWindowChanged;
109
}
110
}
111