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

5
 namespace MetaApplication
namespace MetaApplication6
 {
{7
 /// <summary>
    /// <summary>8
 /// The IWorkbenchWindow is the basic interface to a window which
    /// The IWorkbenchWindow is the basic interface to a window which9
 /// shows a view (represented by the IViewContent object).
    /// shows a view (represented by the IViewContent object).10
 /// </summary>
    /// </summary>11
 public interface IWorkbenchWindow
    public interface IWorkbenchWindow12
 {
    {13
 /// <summary>
        /// <summary>14
 /// The window title.
        /// The window title.15
 /// </summary>
        /// </summary>16
 string Title
        string Title17
 {
        {18
 get;
            get;19
 set;
            set;20
 }
        }21

22
 /// <summary>
        /// <summary>23
 /// The primary view content in this window.
        /// The primary view content in this window.24
 /// </summary>
        /// </summary>25
 IViewContent ViewContent
        IViewContent ViewContent26
 {
        {27
 get;
            get;28
 }
        }29

30
 /// <summary>
        /// <summary>31
 /// returns null if no sub view contents are attached.
        /// returns null if no sub view contents are attached.32
 /// </summary>
        /// </summary>33
 /*
        /*34
 ArrayList SubViewContents {
        ArrayList SubViewContents {35
 get;
            get;36
 }
        }37
 */
        */38

39
 /// <summary>
        /// <summary>40
 /// The current view content which is shown inside this window.
        /// The current view content which is shown inside this window.41
 /// </summary>
        /// </summary>42
 IBaseViewContent ActiveViewContent
        IBaseViewContent ActiveViewContent43
 {
        {44
 get;
            get;45
 }
        }46

47
 /// <summary>
        /// <summary>48
 /// Closes the window, if force == true it closes the window
        /// Closes the window, if force == true it closes the window49
 /// without ask, even the content is dirty.
        /// without ask, even the content is dirty.50
 /// </summary>
        /// </summary>51
 /// <returns>true, if window is closed</returns>
        /// <returns>true, if window is closed</returns>52
 bool CloseWindow(bool force);
        bool CloseWindow(bool force);53

54
 /// <summary>
        /// <summary>55
 /// Brings this window to front and sets the user focus to this
        /// Brings this window to front and sets the user focus to this56
 /// window.
        /// window.57
 /// </summary>
        /// </summary>58
 void SelectWindow();
        void SelectWindow();59

60
 void RedrawContent();
        void RedrawContent();61

62
 void SwitchView(int viewNumber);
        void SwitchView(int viewNumber);63

64
 /// <summary>
        /// <summary>65
 /// Only for internal use.
        /// Only for internal use.66
 /// </summary>
        /// </summary>67
 void OnWindowSelected(EventArgs e);
        void OnWindowSelected(EventArgs e);68
 void OnWindowDeselected(EventArgs e);
        void OnWindowDeselected(EventArgs e);69

70
 //void AttachSecondaryViewContent(ISecondaryViewContent secondaryViewContent);
        //void AttachSecondaryViewContent(ISecondaryViewContent secondaryViewContent);71

72
 /// <summary>
        /// <summary>73
 /// Is called when the window is selected.
        /// Is called when the window is selected.74
 /// </summary>
        /// </summary>75
 event EventHandler WindowSelected;
        event EventHandler WindowSelected;76

77
 /// <summary>
        /// <summary>78
 /// Is called when the window is deselected.
        /// Is called when the window is deselected.79
 /// </summary>
        /// </summary>80
 event EventHandler WindowDeselected;
        event EventHandler WindowDeselected;81

82
 /// <summary>
        /// <summary>83
 /// Is called when the title of this window has changed.
        /// Is called when the title of this window has changed.84
 /// </summary>
        /// </summary>85
 event EventHandler TitleChanged;
        event EventHandler TitleChanged;86

87
 /// <summary>
        /// <summary>88
 /// Is called after the window closes.
        /// Is called after the window closes.89
 /// </summary>
        /// </summary>90
 event EventHandler CloseEvent;
        event EventHandler CloseEvent;91
 }
    }92
 }
}93

 
                    
                 


 
     
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号