本接口定义布局管理器如何管理工作空间中各GUI要素的布局。比如面板的显示、隐藏状态,面板、工作台窗体(视图)的配置,活动面板,显示、隐藏面板,重绘工作台窗体和面板。
定义属性:
 活动工作台窗体,当前活动的视图内容。
定义方法:
 驻于内存,从内存中撤出,显示面板,使面板处于活动状态,隐藏面板,判断面板是否可见,重绘所有组件,导入配合信息,恢复配置信息,活动的工作台窗体发生变化
定义事件:
 活动工作台窗体变化时触发的事件。
 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 IWorkbenchLayout object is responsible for the layout of
    /// The IWorkbenchLayout object is responsible for the layout of 
9![]() /// the workspace, it shows the contents, chooses the IWorkbenchWindow
    /// the workspace, it shows the contents, chooses the IWorkbenchWindow
10![]() /// implementation etc. it could be attached/detached at the runtime
    /// implementation etc. it could be attached/detached at the runtime
11![]() /// to a workbench.
    /// to a workbench.
12![]() /// </summary>
    /// </summary>
13![]() public interface IWorkbenchLayout
    public interface IWorkbenchLayout
14![]() {
    {
15![]() IWorkbenchWindow ActiveWorkbenchwindow
        IWorkbenchWindow ActiveWorkbenchwindow
16![]() {
        {
17![]() get;
            get;
18![]() }
        }
19![]()
20![]() object ActiveContent
        object ActiveContent
21![]() {
        {
22![]() get;
            get;
23![]() }
        }
24![]()
25![]() /// <summary>
        /// <summary>
26![]() /// Attaches this layout manager to a workbench object.
        /// Attaches this layout manager to a workbench object.
27![]() /// </summary>
        /// </summary>
28![]() void Attach(IWorkbench workbench);
        void Attach(IWorkbench workbench);
29![]()
30![]() /// <summary>
        /// <summary>
31![]() /// Detaches this layout manager from the current workspace.
        /// Detaches this layout manager from the current workspace.
32![]() /// </summary>
        /// </summary>
33![]() void Detach();
        void Detach();
34![]()
35![]() /// <summary>
        /// <summary>
36![]() /// Shows a new <see cref="IPadContent"/>.
        /// Shows a new <see cref="IPadContent"/>.
37![]() /// </summary>
        /// </summary>
38![]() void ShowPad(IPadContent content);
        void ShowPad(IPadContent content);
39![]()
40![]() /// <summary>
        /// <summary>
41![]() /// Activates a pad (Show only makes it visible but Activate does
        /// Activates a pad (Show only makes it visible but Activate does
42![]() /// bring it to foreground)
        /// bring it to foreground)
43![]() /// </summary>
        /// </summary>
44![]() void ActivatePad(IPadContent content);
        void ActivatePad(IPadContent content);
45![]() void ActivatePad(string fullyQualifiedTypeName);
        void ActivatePad(string fullyQualifiedTypeName);
46![]()
47![]() /// <summary>
        /// <summary>
48![]() /// Hides a new <see cref="IPadContent"/>.
        /// Hides a new <see cref="IPadContent"/>.
49![]() /// </summary>
        /// </summary>
50![]() void HidePad(IPadContent content);
        void HidePad(IPadContent content);
51![]()
52![]() /// <summary>
        /// <summary>
53![]() /// returns true, if padContent is visible;
        /// returns true, if padContent is visible;
54![]() /// </summary>
        /// </summary>
55![]() bool IsVisible(IPadContent padContent);
        bool IsVisible(IPadContent padContent);
56![]()
57![]() /// <summary>
        /// <summary>
58![]() /// Re-initializes all components of the layout manager.
        /// Re-initializes all components of the layout manager.
59![]() /// </summary>
        /// </summary>
60![]() void RedrawAllComponents();
        void RedrawAllComponents();
61![]()
62![]() /// <summary>
        /// <summary>
63![]() /// Shows a new <see cref="IViewContent"/>.
        /// Shows a new <see cref="IViewContent"/>.
64![]() /// ?????不明白干什么用的,后续会如何使用
        /// ?????不明白干什么用的,后续会如何使用
65![]() /// </summary>
        /// </summary>
66![]() IWorkbenchWindow ShowView(IViewContent content);
        IWorkbenchWindow ShowView(IViewContent content);
67![]()
68![]()
69![]() void LoadConfiguration();
        void LoadConfiguration();
70![]() void StoreConfiguration();
        void StoreConfiguration();
71![]()
72![]() /// <summary>
        /// <summary>
73![]() /// Is called, when the workbench window which the user has into
        /// Is called, when the workbench window which the user has into
74![]() /// the foreground (e.g. editable) changed to a new one.
        /// the foreground (e.g. editable) changed to a new one.
75![]() /// </summary>
        /// </summary>
76![]() event EventHandler ActiveWorkbenchWindowChanged;
        event EventHandler ActiveWorkbenchWindowChanged;
77![]()
78![]() // only needed in the workspace window when the 'secondary view content' changed
        // only needed in the workspace window when the 'secondary view content' changed
79![]() // it is somewhat like 'active workbench window changed'
        // it is somewhat like 'active workbench window changed'
80![]() void OnActiveWorkbenchWindowChanged(EventArgs e);
        void OnActiveWorkbenchWindowChanged(EventArgs e);
81![]() }
    }
82![]() }
}
83![]()
 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 IWorkbenchLayout object is responsible for the layout of
    /// The IWorkbenchLayout object is responsible for the layout of 9
 /// the workspace, it shows the contents, chooses the IWorkbenchWindow
    /// the workspace, it shows the contents, chooses the IWorkbenchWindow10
 /// implementation etc. it could be attached/detached at the runtime
    /// implementation etc. it could be attached/detached at the runtime11
 /// to a workbench.
    /// to a workbench.12
 /// </summary>
    /// </summary>13
 public interface IWorkbenchLayout
    public interface IWorkbenchLayout14
 {
    {15
 IWorkbenchWindow ActiveWorkbenchwindow
        IWorkbenchWindow ActiveWorkbenchwindow16
 {
        {17
 get;
            get;18
 }
        }19

20
 object ActiveContent
        object ActiveContent21
 {
        {22
 get;
            get;23
 }
        }24

25
 /// <summary>
        /// <summary>26
 /// Attaches this layout manager to a workbench object.
        /// Attaches this layout manager to a workbench object.27
 /// </summary>
        /// </summary>28
 void Attach(IWorkbench workbench);
        void Attach(IWorkbench workbench);29

30
 /// <summary>
        /// <summary>31
 /// Detaches this layout manager from the current workspace.
        /// Detaches this layout manager from the current workspace.32
 /// </summary>
        /// </summary>33
 void Detach();
        void Detach();34

35
 /// <summary>
        /// <summary>36
 /// Shows a new <see cref="IPadContent"/>.
        /// Shows a new <see cref="IPadContent"/>.37
 /// </summary>
        /// </summary>38
 void ShowPad(IPadContent content);
        void ShowPad(IPadContent content);39

40
 /// <summary>
        /// <summary>41
 /// Activates a pad (Show only makes it visible but Activate does
        /// Activates a pad (Show only makes it visible but Activate does42
 /// bring it to foreground)
        /// bring it to foreground)43
 /// </summary>
        /// </summary>44
 void ActivatePad(IPadContent content);
        void ActivatePad(IPadContent content);45
 void ActivatePad(string fullyQualifiedTypeName);
        void ActivatePad(string fullyQualifiedTypeName);46

47
 /// <summary>
        /// <summary>48
 /// Hides a new <see cref="IPadContent"/>.
        /// Hides a new <see cref="IPadContent"/>.49
 /// </summary>
        /// </summary>50
 void HidePad(IPadContent content);
        void HidePad(IPadContent content);51

52
 /// <summary>
        /// <summary>53
 /// returns true, if padContent is visible;
        /// returns true, if padContent is visible;54
 /// </summary>
        /// </summary>55
 bool IsVisible(IPadContent padContent);
        bool IsVisible(IPadContent padContent);56

57
 /// <summary>
        /// <summary>58
 /// Re-initializes all components of the layout manager.
        /// Re-initializes all components of the layout manager.59
 /// </summary>
        /// </summary>60
 void RedrawAllComponents();
        void RedrawAllComponents();61

62
 /// <summary>
        /// <summary>63
 /// Shows a new <see cref="IViewContent"/>.
        /// Shows a new <see cref="IViewContent"/>.64
 /// ?????不明白干什么用的,后续会如何使用
        /// ?????不明白干什么用的,后续会如何使用65
 /// </summary>
        /// </summary>66
 IWorkbenchWindow ShowView(IViewContent content);
        IWorkbenchWindow ShowView(IViewContent content);67

68

69
 void LoadConfiguration();
        void LoadConfiguration();70
 void StoreConfiguration();
        void StoreConfiguration();71

72
 /// <summary>
        /// <summary>73
 /// Is called, when the workbench window which the user has into
        /// Is called, when the workbench window which the user has into74
 /// the foreground (e.g. editable) changed to a new one.
        /// the foreground (e.g. editable) changed to a new one.75
 /// </summary>
        /// </summary>76
 event EventHandler ActiveWorkbenchWindowChanged;
        event EventHandler ActiveWorkbenchWindowChanged;77

78
 // only needed in the workspace window when the 'secondary view content' changed
        // only needed in the workspace window when the 'secondary view content' changed79
 // it is somewhat like 'active workbench window changed'
        // it is somewhat like 'active workbench window changed'80
 void OnActiveWorkbenchWindowChanged(EventArgs e);
        void OnActiveWorkbenchWindowChanged(EventArgs e);81
 }
    }82
 }
}83

 
                    
                 


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