-
Notifications
You must be signed in to change notification settings - Fork 11
/
Window1.cs
142 lines (119 loc) · 4.73 KB
/
Window1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
using System;
using Slb.Ocean.Petrel.UI;
namespace LogAnalysis
{
/// <summary>
/// Summary description for Window1.
/// </summary>
public class Window1 : ToggleWindow, IPresentation
{
public Window1()
{
//
// TODO: Add constructor logic here
//
}
#region ToggleWindow Members
/// <summary>
/// This method determines whether the window can show any or all instances
/// of the given Type.
/// </summary>
/// <param name="domainObjType">the Type of domain object to check</param>
/// <returns>
/// "All" if all objects of the given type can be shown,
/// "Some" if only certain instances of the type can be shown,
/// "None" if no objects of the type can be shown.
/// </returns>
protected override ToggleWindowTypeSupport CanShowTypeCore(Type domainObjType)
{
return ToggleWindowTypeSupport.Some;
}
/// <summary>
/// This method determines whether the window can show the given object.
/// </summary>
/// <param name="domainObj">the object to check</param>
/// <returns>true when it can be shown, false when not</returns>
protected override bool CanShowObjectCore(object domainObj)
{
if (domainObj == null)
return false;
return true;
}
/// <summary>
/// This method will be called when the window should show an object.
/// It raises the VisibleObjects.Changed event when necessary.
/// </summary>
/// <param name="domainObj">the object to show in the window</param>
protected override void ShowObjectCore(object domainObj)
{
if (!CanShowObject(domainObj) || IsVisible(domainObj))
return;
// TODO: Add code to show the object in the window
OnVisibleObjectsChanged(VisibilityChangedEventArgs.FromSingleObject(domainObj, VisibilityState.Visible));
}
/// <summary>
/// This method will be called when the window should hide an object.
/// It raises the VisibleObjects.Changed event when necessary.
/// </summary>
/// <param name="domainObj">the object to hide</param>
protected override void HideObjectCore(object domainObj)
{
if (!IsVisible(domainObj))
return;
// TODO: Add code to hide the object
OnVisibleObjectsChanged(VisibilityChangedEventArgs.FromSingleObject(domainObj, VisibilityState.Hidden));
}
/// <summary>
/// Determines whether or not the given object is currently visualized in the window.
/// </summary>
/// <param name="domainObj">the object to check</param>
/// <returns>true if the object is visible; otherwise false</returns>
protected override bool IsVisibleCore(object domainObj)
{
// TODO: Add implementation to determine if the object is showing
return false;
}
/// <summary>
/// Gets an enumerator containing all of the objects currently visible in this window
/// </summary>
/// <returns></returns>
protected override System.Collections.IEnumerator GetVisibleObjectsEnumeratorCore()
{
// TODO: Add implementation to provide the list of visible objects
yield break;
}
/// <summary>
/// This method will be called to get the actual Control to host in the Petrel Form.
/// </summary>
/// <returns>the Control handling visualization for this window</returns>
protected override System.Windows.Forms.Control CreateControlCore()
{
return new Window1UI();
}
/// <summary>
/// This method will be called when the window's Control should be disposed.
/// </summary>
protected override void DisposeControlCore()
{
// TODO: Call Dispose on the Control and/or clean up any additional resources
}
#endregion
#region IPresentation Members
public event EventHandler PresentationChanged;
/// <summary>
/// Gets the text displayed for this window
/// </summary>
public string Text
{
get { return "Window1 name"; }
}
/// <summary>
/// Gets the image displayed for this window
/// </summary>
public System.Drawing.Bitmap Image
{
get { return PetrelImages.Window; }
}
#endregion
}
}