-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSCnotifywithloggingDefinition.cs
More file actions
309 lines (257 loc) · 11.1 KB
/
SCnotifywithloggingDefinition.cs
File metadata and controls
309 lines (257 loc) · 11.1 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
using SCnotifywithlogging.Client;
using SCnotifywithlogging.Admin;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Windows.Forms;
using VideoOS.Platform;
using VideoOS.Platform.Admin;
using VideoOS.Platform.Background;
using VideoOS.Platform.Client;
namespace SCnotifywithlogging
{
/// <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 SCnotifywithloggingDefinition : PluginDefinition
{
private static System.Drawing.Image _treeNodeImage;
private static System.Drawing.Image _topTreeNodeImage;
internal static Guid SCnotifywithloggingPluginId = new Guid("5322de02-9001-46a1-9921-e6046df49b23");
internal static Guid SCnotifywithloggingKind = new Guid("12567fed-74a5-47ab-9076-9def0296cf1d");
internal static Guid SCnotifywithloggingSidePanel = new Guid("17f16147-e2f8-42f7-a400-2d861c240064");
internal static Guid SCnotifywithloggingViewItemPlugin = new Guid("4d400b8f-5810-47a1-a089-5fe8432a5a5a");
internal static Guid SCnotifywithloggingSettingsPanel = new Guid("0b8a7d5f-dee7-4ed3-a9a1-ec62e84101f4");
internal static Guid SCnotifywithloggingBackgroundPlugin = new Guid("11e0c049-04ad-466d-b149-fc3b1a95e74b");
internal static Guid SCnotifywithloggingWorkSpacePluginId = new Guid("7533510f-fdf9-4f09-abac-f226735a76f5");
internal static Guid SCnotifywithloggingWorkSpaceViewItemPluginId = new Guid("bfe514d0-6568-4dea-8a06-276e1a56520b");
internal static Guid SCnotifywithloggingTabPluginId = new Guid("5bee4a8c-4c65-430b-a81b-7c667ee8bf88");
internal static Guid SCnotifywithloggingViewLayoutId = new Guid("72a3c9f0-4780-4334-9068-df3f7ecb4333");
// 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 SCnotifywithloggingWorkSpaceToolbarPluginId = new Guid("22222222-2222-2222-2222-276e1a56520b");
internal static Guid SCnotifywithloggingViewItemToolbarPluginId = new Guid("33333333-3333-3333-3333-276e1a56520b");
internal static Guid SCnotifywithloggingToolsOptionDialogPluginId = new Guid("44444444-4444-4444-4444-276e1a56520b");
#region Private fields
//
// 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 SCnotifywithloggingDefinition()
{
}
/// <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.
if (EnvironmentManager.Instance.EnvironmentType == EnvironmentType.SmartClient)
{
_sidePanelPlugins.Add(new SCnotifywithloggingSidePanelPlugin());
Notification notification = new Notification();
notification.ShowDialog();
}
if (EnvironmentManager.Instance.EnvironmentType == EnvironmentType.Administration)
{
_toolsOptionsDialogPlugins.Add(new SCnotifywithloggingToolsOptionDialogPlugin());
}
}
/// <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();
_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 SCnotifywithloggingPluginId;
}
}
/// <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>
public override Guid SharedNodeId
{
get
{
return Guid.Empty;
}
}
/// <summary>
/// Define name of top level Tree node - e.g. A product name
/// </summary>
public override string Name
{
get { return "Smart Client Logon Notification"; }
}
/// <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>
/// An extension plug-in running in the Administrator to add a tab for built-in devices and hardware.
/// </summary>
public override ICollection<TabPlugin> TabPlugins
{
get { return _tabPlugins; }
}
/// <summary>
/// An extension plug-in running in the Administrator to add more tabs to the Tools-Options dialog.
/// </summary>
public override List<ToolsOptionsDialogPlugin> ToolsOptionsDialogPlugins
{
get { return _toolsOptionsDialogPlugins; }
}
/// <summary>
/// A user control to display when the administrator clicks on the top TreeNode
/// </summary>
/// <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>
/// An extension plug-in to add to the view item toolbar in the Smart Client.
/// </summary>
/// <summary>
/// An extension plug-in to add to the work space toolbar in the Smart Client.
/// </summary>
/// <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>
}
}