工作台窗体接口是描述用来显示视图的窗体基本接口.
每个工作台窗体支持多视图,活动视图为主视图,其他视图为子视图.
其定义的主要内容如下:
1,属性
定义窗体的标题,获取视图,获取子视图列表,获取活动视图属性.
2,方法
包括关闭窗体(是否强行),选择窗体,重绘窗体,窗体内多视图切换(单窗体中tab页切换),选中窗体时(鼠标未按下),未选种窗体时(鼠标未按下)
3,事件
包括窗体关闭事件,标题改变,窗体选中,窗体失去焦点事件
代码如下:
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace MetaApplication
6{
7 /// <summary>
8 /// The IWorkbenchWindow is the basic interface to a window which
9 /// shows a view (represented by the IViewContent object).
10 /// </summary>
11 public interface IWorkbenchWindow
12 {
13 /// <summary>
14 /// The window title.
15 /// </summary>
16 string Title
17 {
18 get;
19 set;
20 }
21
22 /// <summary>
23 /// The primary view content in this window.
24 /// </summary>
25 IViewContent ViewContent
26 {
27 get;
28 }
29
30 /// <summary>
31 /// returns null if no sub view contents are attached.
32 /// </summary>
33 /*
34 ArrayList SubViewContents {
35 get;
36 }
37 */
38
39 /// <summary>
40 /// The current view content which is shown inside this window.
41 /// </summary>
42 IBaseViewContent ActiveViewContent
43 {
44 get;
45 }
46
47 /// <summary>
48 /// Closes the window, if force == true it closes the window
49 /// without ask, even the content is dirty.
50 /// </summary>
51 /// <returns>true, if window is closed</returns>
52 bool CloseWindow(bool force);
53
54 /// <summary>
55 /// Brings this window to front and sets the user focus to this
56 /// window.
57 /// </summary>
58 void SelectWindow();
59
60 void RedrawContent();
61
62 void SwitchView(int viewNumber);
63
64 /// <summary>
65 /// Only for internal use.
66 /// </summary>
67 void OnWindowSelected(EventArgs e);
68 void OnWindowDeselected(EventArgs e);
69
70 //void AttachSecondaryViewContent(ISecondaryViewContent secondaryViewContent);
71
72 /// <summary>
73 /// Is called when the window is selected.
74 /// </summary>
75 event EventHandler WindowSelected;
76
77 /// <summary>
78 /// Is called when the window is deselected.
79 /// </summary>
80 event EventHandler WindowDeselected;
81
82 /// <summary>
83 /// Is called when the title of this window has changed.
84 /// </summary>
85 event EventHandler TitleChanged;
86
87 /// <summary>
88 /// Is called after the window closes.
89 /// </summary>
90 event EventHandler CloseEvent;
91 }
92}
93
2using System.Collections.Generic;
3using System.Text;
4
5namespace MetaApplication
6{
7 /// <summary>
8 /// The IWorkbenchWindow is the basic interface to a window which
9 /// shows a view (represented by the IViewContent object).
10 /// </summary>
11 public interface IWorkbenchWindow
12 {
13 /// <summary>
14 /// The window title.
15 /// </summary>
16 string Title
17 {
18 get;
19 set;
20 }
21
22 /// <summary>
23 /// The primary view content in this window.
24 /// </summary>
25 IViewContent ViewContent
26 {
27 get;
28 }
29
30 /// <summary>
31 /// returns null if no sub view contents are attached.
32 /// </summary>
33 /*
34 ArrayList SubViewContents {
35 get;
36 }
37 */
38
39 /// <summary>
40 /// The current view content which is shown inside this window.
41 /// </summary>
42 IBaseViewContent ActiveViewContent
43 {
44 get;
45 }
46
47 /// <summary>
48 /// Closes the window, if force == true it closes the window
49 /// without ask, even the content is dirty.
50 /// </summary>
51 /// <returns>true, if window is closed</returns>
52 bool CloseWindow(bool force);
53
54 /// <summary>
55 /// Brings this window to front and sets the user focus to this
56 /// window.
57 /// </summary>
58 void SelectWindow();
59
60 void RedrawContent();
61
62 void SwitchView(int viewNumber);
63
64 /// <summary>
65 /// Only for internal use.
66 /// </summary>
67 void OnWindowSelected(EventArgs e);
68 void OnWindowDeselected(EventArgs e);
69
70 //void AttachSecondaryViewContent(ISecondaryViewContent secondaryViewContent);
71
72 /// <summary>
73 /// Is called when the window is selected.
74 /// </summary>
75 event EventHandler WindowSelected;
76
77 /// <summary>
78 /// Is called when the window is deselected.
79 /// </summary>
80 event EventHandler WindowDeselected;
81
82 /// <summary>
83 /// Is called when the title of this window has changed.
84 /// </summary>
85 event EventHandler TitleChanged;
86
87 /// <summary>
88 /// Is called after the window closes.
89 /// </summary>
90 event EventHandler CloseEvent;
91 }
92}
93