工作台接口是基础管理框架的核心接口.
其主要功能是
1,工作台包含的属性
定义工作空间的工程标题,工作布局管理器获取和设置方法;视图对象集合,面板对象集合,工作台窗体对象集合,当前活动工作台窗体对象,当前活动视图对象的获取等属性;
2,方法
定义工作空间显示视图,显示面板,获取面板,关闭特定视图,关闭全部视图,重绘所有组件
3,事件
定义在工作空间中视图打开后,视图关闭后,活动工作台窗体变化后三个事件,以满足视图内容的修改保存,序列化的需求.
  1![]() using System;
using System;
2![]() using System.Collections.Generic;
using System.Collections.Generic;
3![]() using System.Text;
using System.Text;
4![]() using MetaApplication.ContentInterfaces;
using MetaApplication.ContentInterfaces;
5![]()
6![]() namespace MetaApplication
namespace MetaApplication
7![]() {
{
8![]() /// <summary>
    /// <summary>
9![]() /// This is the basic interface to the workspace.
    /// This is the basic interface to the workspace.
10![]() /// </summary>
    /// </summary>
11![]() public interface IWorkbench : IMementoCapable
    public interface IWorkbench : IMementoCapable
12![]() {
    {
13![]() /// <summary>
        /// <summary>
14![]() /// The title shown in the title bar.
        /// The title shown in the title bar.
15![]() /// </summary>
        /// </summary>
16![]() string Title
        string Title
17![]() {
        {
18![]() get;
            get;
19![]() set;
            set;
20![]() }
        }
21![]()
22![]() /// <summary>
        /// <summary>
23![]() /// A collection in which all active workspace windows are saved.
        /// A collection in which all active workspace windows are saved.
24![]() /// </summary>
        /// </summary>
25![]() List<IViewContent> ViewContentCollection
        List<IViewContent> ViewContentCollection
26![]() {
        {
27![]() get;
            get;
28![]() }
        }
29![]()
30![]() /// <summary>
        /// <summary>
31![]() /// A collection in which all active workspace windows are saved.
        /// A collection in which all active workspace windows are saved.
32![]() /// </summary>
        /// </summary>
33![]() List<IPadContent> PadContentCollection
        List<IPadContent> PadContentCollection
34![]() {
        {
35![]() get;
            get;
36![]() }
        }
37![]()
38![]() /// <summary>
        /// <summary>
39![]() /// The active workbench window.
        /// The active workbench window.
40![]() /// </summary>
        /// </summary>
41![]() IWorkbenchWindow ActiveWorkbenchWindow
        IWorkbenchWindow ActiveWorkbenchWindow
42![]() {
        {
43![]() get;
            get;
44![]() }
        }
45![]()
46![]() object ActiveContent
        object ActiveContent
47![]() {
        {
48![]() get;
            get;
49![]() }
        }
50![]()
51![]() IWorkbenchLayout WorkbenchLayout
        IWorkbenchLayout WorkbenchLayout
52![]() {
        {
53![]() get;
            get;
54![]() set;
            set;
55![]() }
        }
56![]()
57![]() /// <summary>
        /// <summary>
58![]() /// Inserts a new <see cref="IViewContent"/> object in the workspace.
        /// Inserts a new <see cref="IViewContent"/> object in the workspace.
59![]() /// </summary>
        /// </summary>
60![]() void ShowView(IViewContent content);
        void ShowView(IViewContent content);
61![]()
62![]() /// <summary>
        /// <summary>
63![]() /// Inserts a new <see cref="IPadContent"/> object in the workspace.
        /// Inserts a new <see cref="IPadContent"/> object in the workspace.
64![]() /// </summary>
        /// </summary>
65![]() void ShowPad(IPadContent content);
        void ShowPad(IPadContent content);
66![]()
67![]() /// <summary>
        /// <summary>
68![]() /// Returns a pad from a specific type.
        /// Returns a pad from a specific type.
69![]() /// </summary>
        /// </summary>
70![]() IPadContent GetPad(Type type);
        IPadContent GetPad(Type type);
71![]()
72![]() /// <summary>
        /// <summary>
73![]() /// Closes the IViewContent content when content is open.
        /// Closes the IViewContent content when content is open.
74![]() /// </summary>
        /// </summary>
75![]() void CloseContent(IViewContent content);
        void CloseContent(IViewContent content);
76![]()
77![]() /// <summary>
        /// <summary>
78![]() /// Closes all views inside the workbench.
        /// Closes all views inside the workbench.
79![]() /// </summary>
        /// </summary>
80![]() void CloseAllViews();
        void CloseAllViews();
81![]()
82![]() /// <summary>
        /// <summary>
83![]() /// Re-initializes all components of the workbench, should be called
        /// Re-initializes all components of the workbench, should be called
84![]() /// when a special property is changed that affects layout stuff.
        /// when a special property is changed that affects layout stuff.
85![]() /// (like language change)
        /// (like language change) 
86![]() /// </summary>
        /// </summary>
87![]() void RedrawAllComponents();
        void RedrawAllComponents();
88![]()
89![]() /// <summary>
        /// <summary>
90![]() /// Is called, when a workbench view was opened
        /// Is called, when a workbench view was opened
91![]() /// </summary>
        /// </summary>
92![]() /// <example>
        /// <example>
93![]() /// WorkbenchSingleton.WorkbenchCreated += delegate {
        /// WorkbenchSingleton.WorkbenchCreated += delegate { 
94![]() ///     WorkbenchSingleton.Workbench.ViewOpened +=
        ///     WorkbenchSingleton.Workbench.ViewOpened += ![]() ;
;
95![]() /// };
        /// };
96![]() /// </example>
        /// </example>
97![]() event EventHandler ViewOpened;
        event EventHandler ViewOpened;
98![]()
99![]() /// <summary>
        /// <summary>
100![]() /// Is called, when a workbench view was closed
        /// Is called, when a workbench view was closed
101![]() /// </summary>
        /// </summary>
102![]() event EventHandler ViewClosed;
        event EventHandler ViewClosed;
103![]()
104![]() /// <summary>
        /// <summary>
105![]() /// Is called, when the workbench window which the user has into
        /// Is called, when the workbench window which the user has into
106![]() /// the foreground (e.g. editable) changed to a new one.
        /// the foreground (e.g. editable) changed to a new one.
107![]() /// </summary>
        /// </summary>
108![]() event EventHandler ActiveWorkbenchWindowChanged;
        event EventHandler ActiveWorkbenchWindowChanged;
109![]() }
    }
110![]() }
}
111![]()
 using System;
using System;2
 using System.Collections.Generic;
using System.Collections.Generic;3
 using System.Text;
using System.Text;4
 using MetaApplication.ContentInterfaces;
using MetaApplication.ContentInterfaces;5

6
 namespace MetaApplication
namespace MetaApplication7
 {
{8
 /// <summary>
    /// <summary>9
 /// This is the basic interface to the workspace.
    /// This is the basic interface to the workspace.10
 /// </summary>
    /// </summary>11
 public interface IWorkbench : IMementoCapable
    public interface IWorkbench : IMementoCapable12
 {
    {13
 /// <summary>
        /// <summary>14
 /// The title shown in the title bar.
        /// The title shown in the title bar.15
 /// </summary>
        /// </summary>16
 string Title
        string Title17
 {
        {18
 get;
            get;19
 set;
            set;20
 }
        }21

22
 /// <summary>
        /// <summary>23
 /// A collection in which all active workspace windows are saved.
        /// A collection in which all active workspace windows are saved.24
 /// </summary>
        /// </summary>25
 List<IViewContent> ViewContentCollection
        List<IViewContent> ViewContentCollection26
 {
        {27
 get;
            get;28
 }
        }29

30
 /// <summary>
        /// <summary>31
 /// A collection in which all active workspace windows are saved.
        /// A collection in which all active workspace windows are saved.32
 /// </summary>
        /// </summary>33
 List<IPadContent> PadContentCollection
        List<IPadContent> PadContentCollection34
 {
        {35
 get;
            get;36
 }
        }37

38
 /// <summary>
        /// <summary>39
 /// The active workbench window.
        /// The active workbench window.40
 /// </summary>
        /// </summary>41
 IWorkbenchWindow ActiveWorkbenchWindow
        IWorkbenchWindow ActiveWorkbenchWindow42
 {
        {43
 get;
            get;44
 }
        }45

46
 object ActiveContent
        object ActiveContent47
 {
        {48
 get;
            get;49
 }
        }50

51
 IWorkbenchLayout WorkbenchLayout
        IWorkbenchLayout WorkbenchLayout52
 {
        {53
 get;
            get;54
 set;
            set;55
 }
        }56

57
 /// <summary>
        /// <summary>58
 /// Inserts a new <see cref="IViewContent"/> object in the workspace.
        /// Inserts a new <see cref="IViewContent"/> object in the workspace.59
 /// </summary>
        /// </summary>60
 void ShowView(IViewContent content);
        void ShowView(IViewContent content);61

62
 /// <summary>
        /// <summary>63
 /// Inserts a new <see cref="IPadContent"/> object in the workspace.
        /// Inserts a new <see cref="IPadContent"/> object in the workspace.64
 /// </summary>
        /// </summary>65
 void ShowPad(IPadContent content);
        void ShowPad(IPadContent content);66

67
 /// <summary>
        /// <summary>68
 /// Returns a pad from a specific type.
        /// Returns a pad from a specific type.69
 /// </summary>
        /// </summary>70
 IPadContent GetPad(Type type);
        IPadContent GetPad(Type type);71

72
 /// <summary>
        /// <summary>73
 /// Closes the IViewContent content when content is open.
        /// Closes the IViewContent content when content is open.74
 /// </summary>
        /// </summary>75
 void CloseContent(IViewContent content);
        void CloseContent(IViewContent content);76

77
 /// <summary>
        /// <summary>78
 /// Closes all views inside the workbench.
        /// Closes all views inside the workbench.79
 /// </summary>
        /// </summary>80
 void CloseAllViews();
        void CloseAllViews();81

82
 /// <summary>
        /// <summary>83
 /// Re-initializes all components of the workbench, should be called
        /// Re-initializes all components of the workbench, should be called84
 /// when a special property is changed that affects layout stuff.
        /// when a special property is changed that affects layout stuff.85
 /// (like language change)
        /// (like language change) 86
 /// </summary>
        /// </summary>87
 void RedrawAllComponents();
        void RedrawAllComponents();88

89
 /// <summary>
        /// <summary>90
 /// Is called, when a workbench view was opened
        /// Is called, when a workbench view was opened91
 /// </summary>
        /// </summary>92
 /// <example>
        /// <example>93
 /// WorkbenchSingleton.WorkbenchCreated += delegate {
        /// WorkbenchSingleton.WorkbenchCreated += delegate { 94
 ///     WorkbenchSingleton.Workbench.ViewOpened +=
        ///     WorkbenchSingleton.Workbench.ViewOpened +=  ;
;95
 /// };
        /// };96
 /// </example>
        /// </example>97
 event EventHandler ViewOpened;
        event EventHandler ViewOpened;98

99
 /// <summary>
        /// <summary>100
 /// Is called, when a workbench view was closed
        /// Is called, when a workbench view was closed101
 /// </summary>
        /// </summary>102
 event EventHandler ViewClosed;
        event EventHandler ViewClosed;103

104
 /// <summary>
        /// <summary>105
 /// Is called, when the workbench window which the user has into
        /// Is called, when the workbench window which the user has into106
 /// the foreground (e.g. editable) changed to a new one.
        /// the foreground (e.g. editable) changed to a new one.107
 /// </summary>
        /// </summary>108
 event EventHandler ActiveWorkbenchWindowChanged;
        event EventHandler ActiveWorkbenchWindowChanged;109
 }
    }110
 }
}111

 
                    
                 

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