-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCamera_ReviewDefinition.cs
More file actions
325 lines (277 loc) · 11.8 KB
/
Camera_ReviewDefinition.cs
File metadata and controls
325 lines (277 loc) · 11.8 KB
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
using Camera_Review.Admin;
using Camera_Review.Background;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
using VideoOS.Platform;
using VideoOS.Platform.Admin;
using VideoOS.Platform.Background;
using VideoOS.Platform.Client;
namespace Camera_Review
{
/// <summary>
/// The PluginDefinition is the ‘entry’ point to any plugin.
/// This is the starting point for any plugin development and the class MUST be available for a plugin to be loaded.
/// Several PluginDefinitions are allowed to be available within one DLL.
/// Here the references to all other plugin known objects and classes are defined.
/// The class is an abstract class where all implemented methods and properties need to be declared with override.
/// The class is constructed when the environment is loading the DLL.
/// </summary>
public class Camera_ReviewDefinition : PluginDefinition
{
private static System.Drawing.Image _treeNodeImage;
private static System.Drawing.Image _topTreeNodeImage;
internal static Guid Camera_ReviewPluginId = new Guid("06953d48-d082-4a7b-ab09-03ca8f2c6632");
internal static Guid Camera_ReviewKind = new Guid("2fa09d1c-d908-4d97-a910-84653bd1e750");
internal static Guid Camera_ReviewSidePanel = new Guid("6ac2d947-4cdb-4d66-a460-8ab933530909");
internal static Guid Camera_ReviewViewItemPlugin = new Guid("1604319a-46fb-4ef3-b89f-bd184a5e13c4");
internal static Guid Camera_ReviewSettingsPanel = new Guid("76051afc-d54e-4d7e-bc9c-311582755eb1");
internal static Guid Camera_ReviewBackgroundPlugin = new Guid("716106f2-ae06-4268-8e60-5eb00f44d46e");
internal static Guid Camera_ReviewWorkSpacePluginId = new Guid("b88e76c4-e024-44a5-b4e4-d407404b204d");
internal static Guid Camera_ReviewWorkSpaceViewItemPluginId = new Guid("0e72f53e-4835-4865-a406-fcfd369469bb");
internal static Guid Camera_ReviewTabPluginId = new Guid("9cb0e0b1-383e-4b4a-ba35-383876029f63");
internal static Guid Camera_ReviewViewLayoutId = new Guid("ad6cbeb8-5e23-4c4a-a3fc-ca8655f90f8f");
// IMPORTANT! Due to shortcoming in Visual Studio template the below cannot be automatically replaced with proper unique GUIDs, so you will have to do it yourself
internal static Guid Camera_ReviewWorkSpaceToolbarPluginId = new Guid("22222222-2222-2222-2222-222222222222");
internal static Guid Camera_ReviewViewItemToolbarPluginId = new Guid("33333333-3333-3333-3333-333333333333");
internal static Guid Camera_ReviewToolsOptionDialogPluginId = new Guid("44444444-4444-4444-4444-444444444444");
#region Private fields
private UserControl _treeNodeInofUserControl;
//
// Note that all the plugin are constructed during application start, and the constructors
// should only contain code that references their own dll, e.g. resource load.
private List<BackgroundPlugin> _backgroundPlugins = new List<BackgroundPlugin>();
private Collection<SettingsPanelPlugin> _settingsPanelPlugins = new Collection<SettingsPanelPlugin>();
private List<ViewItemPlugin> _viewItemPlugins = new List<ViewItemPlugin>();
private List<ItemNode> _itemNodes = new List<ItemNode>();
private List<SidePanelPlugin> _sidePanelPlugins = new List<SidePanelPlugin>();
private List<String> _messageIdStrings = new List<string>();
private List<SecurityAction> _securityActions = new List<SecurityAction>();
private List<WorkSpacePlugin> _workSpacePlugins = new List<WorkSpacePlugin>();
private List<TabPlugin> _tabPlugins = new List<TabPlugin>();
private List<ViewItemToolbarPlugin> _viewItemToolbarPlugins = new List<ViewItemToolbarPlugin>();
private List<WorkSpaceToolbarPlugin> _workSpaceToolbarPlugins = new List<WorkSpaceToolbarPlugin>();
private List<ToolsOptionsDialogPlugin> _toolsOptionsDialogPlugins = new List<ToolsOptionsDialogPlugin>();
#endregion
#region Initialization
/// <summary>
/// Load resources
/// </summary>
static Camera_ReviewDefinition()
{
_treeNodeImage = Properties.Resources.DummyItem;
_topTreeNodeImage = Properties.Resources.Server;
}
/// <summary>
/// Get the icon for the plugin
/// </summary>
internal static Image TreeNodeImage
{
get { return _treeNodeImage; }
}
#endregion
/// <summary>
/// This method is called when the environment is up and running.
/// Registration of Messages via RegisterReceiver can be done at this point.
/// </summary>
public override void Init()
{
// Populate all relevant lists with your plugins etc.
_itemNodes.Add(new ItemNode(Camera_ReviewKind, Guid.Empty,
"Camera_Review", _treeNodeImage,
"Camera_Reviews", _treeNodeImage,
Category.Text, true,
ItemsAllowed.One,
new Camera_ReviewItemManager(Camera_ReviewKind),
null
)
{
SortKey = 1,
PlacementHint = PlacementHint.Default
});
if (EnvironmentManager.Instance.EnvironmentType == EnvironmentType.SmartClient)
{
}
if (EnvironmentManager.Instance.EnvironmentType == EnvironmentType.Administration)
{
}
}
/// <summary>
/// The main application is about to be in an undetermined state, either logging off or exiting.
/// You can release resources at this point, it should match what you acquired during Init, so additional call to Init() will work.
/// </summary>
public override void Close()
{
_itemNodes.Clear();
_sidePanelPlugins.Clear();
_viewItemPlugins.Clear();
_settingsPanelPlugins.Clear();
_backgroundPlugins.Clear();
_workSpacePlugins.Clear();
_tabPlugins.Clear();
_viewItemToolbarPlugins.Clear();
_workSpaceToolbarPlugins.Clear();
_toolsOptionsDialogPlugins.Clear();
}
/// <summary>
/// Return any new messages that this plugin can use in SendMessage or PostMessage,
/// or has a Receiver set up to listen for.
/// The suggested format is: "YourCompany.Area.MessageId"
/// </summary>
public override List<string> PluginDefinedMessageIds
{
get
{
return _messageIdStrings;
}
}
/// <summary>
/// If authorization is to be used, add the SecurityActions the entire plugin
/// would like to be available. E.g. Application level authorization.
/// </summary>
public override List<SecurityAction> SecurityActions
{
get
{
return _securityActions;
}
set
{
}
}
#region Identification Properties
/// <summary>
/// Gets the unique id identifying this plugin component
/// </summary>
public override Guid Id
{
get
{
return Camera_ReviewPluginId;
}
}
/// <summary>
/// This Guid can be defined on several different IPluginDefinitions with the same value,
/// and will result in a combination of this top level ProductNode for several plugins.
/// Set to Guid.Empty if no sharing is enabled.
/// </summary>
/// <summary>
/// Define name of top level Tree node - e.g. A product name
/// </summary>
public override string Name
{
get { return "Camera Review"; }
}
/// <summary>
/// Your company name
/// </summary>
public override string Manufacturer
{
get
{
return "4Js";
}
}
/// <summary>
/// Version of this plugin.
/// </summary>
public override string VersionString
{
get
{
return "1.0.0.0";
}
}
/// <summary>
/// Icon to be used on top level - e.g. a product or company logo
/// </summary>
public override System.Drawing.Image Icon
{
get { return _topTreeNodeImage; }
}
#endregion
#region Administration properties
/// <summary>
/// A list of server side configuration items in the administrator
/// </summary>
public override List<ItemNode> ItemNodes
{
get { return _itemNodes; }
}
/// <summary>
/// A user control to display when the administrator clicks on the top TreeNode
/// </summary>
public override UserControl GenerateUserControl()
{
_treeNodeInofUserControl = new HelpPage();
return _treeNodeInofUserControl;
}
/// <summary>
/// This property can be set to true, to be able to display your own help UserControl on the entire panel.
/// When this is false - a standard top and left side is added by the system.
/// </summary>
public override bool UserControlFillEntirePanel
{
get { return false; }
}
#endregion
#region Client related methods and properties
/// <summary>
/// A list of Client side definitions for Smart Client
/// </summary>
public override List<ViewItemPlugin> ViewItemPlugins
{
get { return _viewItemPlugins; }
}
/// <summary>
/// An extension plug-in running in the Smart Client to add more choices on the Settings panel.
/// Supported from Smart Client 2017 R1. For older versions use OptionsDialogPlugins instead.
/// </summary>
public override Collection<SettingsPanelPlugin> SettingsPanelPlugins
{
get { return _settingsPanelPlugins; }
}
/// <summary>
/// An extension plugin to add to the side panel of the Smart Client.
/// </summary>
public override List<SidePanelPlugin> SidePanelPlugins
{
get { return _sidePanelPlugins; }
}
/// <summary>
/// Return the workspace plugins
/// </summary>
public override List<WorkSpacePlugin> WorkSpacePlugins
{
get { return _workSpacePlugins; }
}
/// <summary>
/// An extension plug-in to add to the view item toolbar in the Smart Client.
/// </summary>
public override List<ViewItemToolbarPlugin> ViewItemToolbarPlugins
{
get { return _viewItemToolbarPlugins; }
}
/// <summary>
/// An extension plug-in to add to the work space toolbar in the Smart Client.
/// </summary>
public override List<WorkSpaceToolbarPlugin> WorkSpaceToolbarPlugins
{
get { return _workSpaceToolbarPlugins; }
}
/// <summary>
/// An extension plug-in running in the Smart Client to provide extra view layouts.
/// </summary>
#endregion
/// <summary>
/// Create and returns the background task.
/// </summary>
public override List<BackgroundPlugin> BackgroundPlugins
{
get { return _backgroundPlugins; }
}
}
}