~manishsinha/zeitgeist-sharp/architecture-issues

« back to all changes in this revision

Viewing changes to Zeitgeist/Datamodel/Manifestation.cs

  • Committer: Manish Sinha
  • Date: 2010-10-02 05:20:40 UTC
  • Revision ID: mail@manishsinha.net-20101002052040-3zm3yadg0eq0hrfi
Changed the KeyValuePair<string,string> to a custom Data Type named NameUri with fields Name and Uri instead of Key and Value
Fixed LP bug #651341

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
                /// <remarks>
32
32
                /// http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#CalendarDataObject
33
33
                /// </remarks>
34
 
                public KeyValuePair<string, string> CalendarDataObject
 
34
                public NameUri CalendarDataObject
35
35
                {
36
36
                        get
37
37
                        {
73
73
                /// <remarks>
74
74
                /// http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HardDiskPartition
75
75
                /// </remarks>
76
 
                public KeyValuePair<string, string> HardDiskPartition
 
76
                public NameUri HardDiskPartition
77
77
                {
78
78
                        get
79
79
                        {
87
87
                /// <remarks>
88
88
                /// http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#MailboxDataObject
89
89
                /// </remarks>
90
 
                public KeyValuePair<string, string> MailboxDataObject
 
90
                public NameUri MailboxDataObject
91
91
                {
92
92
                        get
93
93
                        {
101
101
                /// <remarks>
102
102
                /// http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MediaStream
103
103
                /// </remarks>
104
 
                public KeyValuePair<string, string> MediaStream
 
104
                public NameUri MediaStream
105
105
                {
106
106
                        get
107
107
                        {
115
115
                /// <remarks>
116
116
                /// http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemotePortAddress
117
117
                /// </remarks>
118
 
                public KeyValuePair<string, string> RemotePortAddress
 
118
                public NameUri RemotePortAddress
119
119
                {
120
120
                        get
121
121
                        {
129
129
                /// <remarks>
130
130
                /// http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareItem
131
131
                /// </remarks>
132
 
                public KeyValuePair<string, string> SoftwareItem
 
132
                public NameUri SoftwareItem
133
133
                {
134
134
                        get
135
135
                        {
143
143
                /// <remarks>
144
144
                /// http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareService
145
145
                /// </remarks>
146
 
                public KeyValuePair<string, string> SoftwareService
 
146
                public NameUri SoftwareService
147
147
                {
148
148
                        get
149
149
                        {
151
151
                        }
152
152
                }
153
153
                
154
 
                public KeyValuePair<string, string> Search(string manifestation)
 
154
                public NameUri Search(string manifestation)
155
155
                {
156
 
                        if(string.Equals(_cal_data_obj.Value, manifestation))
 
156
                        if(string.Equals(_cal_data_obj.Uri, manifestation))
157
157
                           return _cal_data_obj;
158
158
                        
159
 
                        KeyValuePair<string, string> event_manifestation = _event_manifestation.Search(manifestation);
160
 
                        if(event_manifestation.Key != null)
 
159
                        NameUri event_manifestation = _event_manifestation.Search(manifestation);
 
160
                        if(event_manifestation.Name != null)
161
161
                                return event_manifestation;
162
162
                        
163
 
                        KeyValuePair<string, string> file_data_obj = _file_data_obj.Search(manifestation);
164
 
                        if(file_data_obj.Key != null)
 
163
                        NameUri file_data_obj = _file_data_obj.Search(manifestation);
 
164
                        if(file_data_obj.Name != null)
165
165
                                return file_data_obj;
166
166
                        
167
 
                        if(string.Equals(_hd_partition.Value, manifestation))
 
167
                        if(string.Equals(_hd_partition.Uri, manifestation))
168
168
                           return _hd_partition;
169
169
                        
170
 
                        if(string.Equals(_mailbox_data_obj.Value, manifestation))
 
170
                        if(string.Equals(_mailbox_data_obj.Uri, manifestation))
171
171
                           return _mailbox_data_obj;
172
172
                        
173
 
                        if(string.Equals(_media_stream.Value, manifestation))
 
173
                        if(string.Equals(_media_stream.Uri, manifestation))
174
174
                           return _media_stream;
175
175
                        
176
 
                        if(string.Equals(_remote_port_addr.Value, manifestation))
 
176
                        if(string.Equals(_remote_port_addr.Uri, manifestation))
177
177
                           return _remote_port_addr;
178
178
                        
179
 
                        if(string.Equals(_sw_item.Value, manifestation))
 
179
                        if(string.Equals(_sw_item.Uri, manifestation))
180
180
                           return _sw_item;
181
181
                        
182
 
                        if(string.Equals(_sw_service.Value, manifestation))
 
182
                        if(string.Equals(_sw_service.Uri, manifestation))
183
183
                           return _sw_service;
184
184
                        
185
 
                        return new KeyValuePair<string, string>();
 
185
                        return new NameUri();
186
186
                }
187
187
                
188
188
                #region Private Fields
189
189
                
190
190
                private static Manifestation _singleton_obj = new Manifestation();
191
191
                
192
 
                private KeyValuePair<string, string> _cal_data_obj = new KeyValuePair<string, string>("CalendarDataObject", "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#CalendarDataObject");
 
192
                private NameUri _cal_data_obj = new NameUri("CalendarDataObject", "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#CalendarDataObject");
193
193
                
194
194
                private EventManifestationType _event_manifestation = new EventManifestationType();
195
195
                
196
196
                private FileDataObjectType _file_data_obj = new FileDataObjectType();
197
197
                
198
 
                private KeyValuePair<string, string> _hd_partition = new KeyValuePair<string, string>("HardDiskPartition", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HardDiskPartition");
199
 
                
200
 
                private KeyValuePair<string, string> _mailbox_data_obj = new KeyValuePair<string, string>("MailboxDataObject", "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#MailboxDataObject");
201
 
                
202
 
                private KeyValuePair<string, string> _media_stream = new KeyValuePair<string, string>("MediaStream", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MediaStream");
203
 
                
204
 
                private KeyValuePair<string, string> _remote_port_addr = new KeyValuePair<string, string>("RemotePortAddress", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemotePortAddress");
205
 
                
206
 
                private KeyValuePair<string, string> _sw_item = new KeyValuePair<string, string>("SoftwareItem", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareItem");
207
 
                
208
 
                private KeyValuePair<string, string> _sw_service = new KeyValuePair<string, string>("SoftwareService", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareService");
 
198
                private NameUri _hd_partition = new NameUri("HardDiskPartition", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HardDiskPartition");
 
199
                
 
200
                private NameUri _mailbox_data_obj = new NameUri("MailboxDataObject", "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#MailboxDataObject");
 
201
                
 
202
                private NameUri _media_stream = new NameUri("MediaStream", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MediaStream");
 
203
                
 
204
                private NameUri _remote_port_addr = new NameUri("RemotePortAddress", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemotePortAddress");
 
205
                
 
206
                private NameUri _sw_item = new NameUri("SoftwareItem", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareItem");
 
207
                
 
208
                private NameUri _sw_service = new NameUri("SoftwareService", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareService");
209
209
                
210
210
                #endregion
211
211
        }
218
218
                /// <remarks>
219
219
                /// http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#EventManifestation
220
220
                /// </remarks>
221
 
                public KeyValuePair<string, string> EventManifestation
 
221
                public NameUri EventManifestation
222
222
                {
223
223
                        get
224
224
                        {
232
232
                /// <remarks>
233
233
                /// http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#HeuristicActivity
234
234
                /// </remarks>
235
 
                public KeyValuePair<string, string> HeuristicActivity
 
235
                public NameUri HeuristicActivity
236
236
                {
237
237
                        get
238
238
                        {
246
246
                /// <remarks>
247
247
                /// http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ScheduledActivity
248
248
                /// </remarks>
249
 
                public KeyValuePair<string, string> ScheduledActivity
 
249
                public NameUri ScheduledActivity
250
250
                {
251
251
                        get
252
252
                        {
260
260
                /// <remarks>
261
261
                /// http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#SystemNotification
262
262
                /// </remarks>
263
 
                public KeyValuePair<string, string> SystemNotification
 
263
                public NameUri SystemNotification
264
264
                {
265
265
                        get
266
266
                        {
274
274
                /// <remarks>
275
275
                /// http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#UserActivity
276
276
                /// </remarks>
277
 
                public KeyValuePair<string, string> UserActivity
 
277
                public NameUri UserActivity
278
278
                {
279
279
                        get
280
280
                        {
288
288
                /// <remarks>
289
289
                /// http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#WorldActivity
290
290
                /// </remarks>
291
 
                public KeyValuePair<string, string> WorldActivity
 
291
                public NameUri WorldActivity
292
292
                {
293
293
                        get
294
294
                        {
296
296
                        }
297
297
                }
298
298
                
299
 
                public KeyValuePair<string, string> Search(string manifestation)
 
299
                public NameUri Search(string manifestation)
300
300
                {
301
 
                        if(string.Equals(_evnt_manifest.Value, manifestation))
 
301
                        if(string.Equals(_evnt_manifest.Uri, manifestation))
302
302
                           return _evnt_manifest;
303
303
                        
304
 
                        if(string.Equals(_heur_activity.Value, manifestation))
 
304
                        if(string.Equals(_heur_activity.Uri, manifestation))
305
305
                           return _heur_activity;
306
306
                        
307
 
                        if(string.Equals(_schld_activity.Value, manifestation))
 
307
                        if(string.Equals(_schld_activity.Uri, manifestation))
308
308
                           return _schld_activity;
309
309
                        
310
 
                        if(string.Equals(_sys_notification.Value, manifestation))
 
310
                        if(string.Equals(_sys_notification.Uri, manifestation))
311
311
                           return _sys_notification;
312
312
                        
313
 
                        if(string.Equals(_user_activity.Value, manifestation))
 
313
                        if(string.Equals(_user_activity.Uri, manifestation))
314
314
                           return _user_activity;
315
315
                        
316
 
                        if(string.Equals(_world_activity.Value, manifestation))
 
316
                        if(string.Equals(_world_activity.Uri, manifestation))
317
317
                           return _world_activity;
318
318
                        
319
 
                        return new KeyValuePair<string, string>();
 
319
                        return new NameUri();
320
320
                }
321
321
                
322
322
                #region Private Fields
323
323
                
324
 
                private KeyValuePair<string, string> _evnt_manifest = new KeyValuePair<string, string>("EventManifestation", "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#EventManifestation");
325
 
                
326
 
                private KeyValuePair<string, string> _heur_activity = new KeyValuePair<string, string>("HeuristicActivity", "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#HeuristicActivity");
327
 
                
328
 
                private KeyValuePair<string, string> _schld_activity = new KeyValuePair<string, string>("ScheduledActivity", "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ScheduledActivity");
329
 
                
330
 
                private KeyValuePair<string, string> _sys_notification = new KeyValuePair<string, string>("SystemNotification", "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#SystemNotification");
331
 
                
332
 
                private KeyValuePair<string, string> _user_activity = new KeyValuePair<string, string>("UserActivity", "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#UserActivity");
333
 
                
334
 
                private KeyValuePair<string, string> _world_activity = new KeyValuePair<string, string>("WorldActivity", "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#WorldActivity");
 
324
                private NameUri _evnt_manifest = new NameUri("EventManifestation", "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#EventManifestation");
 
325
                
 
326
                private NameUri _heur_activity = new NameUri("HeuristicActivity", "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#HeuristicActivity");
 
327
                
 
328
                private NameUri _schld_activity = new NameUri("ScheduledActivity", "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ScheduledActivity");
 
329
                
 
330
                private NameUri _sys_notification = new NameUri("SystemNotification", "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#SystemNotification");
 
331
                
 
332
                private NameUri _user_activity = new NameUri("UserActivity", "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#UserActivity");
 
333
                
 
334
                private NameUri _world_activity = new NameUri("WorldActivity", "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#WorldActivity");
335
335
                
336
336
                #endregion
337
337
        }
344
344
                /// <remarks>
345
345
                /// http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject
346
346
                /// </remarks>
347
 
                public KeyValuePair<string, string> FileDataObject
 
347
                public NameUri FileDataObject
348
348
                {
349
349
                        get
350
350
                        {
358
358
                /// <remarks>
359
359
                /// http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#DeletedResource
360
360
                /// </remarks>
361
 
                public KeyValuePair<string, string> DeletedResource
 
361
                public NameUri DeletedResource
362
362
                {
363
363
                        get
364
364
                        {
386
386
                /// <remarks>
387
387
                /// http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemoteDataObject
388
388
                /// </remarks>
389
 
                public KeyValuePair<string, string> RemoteDataObject
 
389
                public NameUri RemoteDataObject
390
390
                {
391
391
                        get
392
392
                        {
394
394
                        }
395
395
                }
396
396
                
397
 
                public KeyValuePair<string, string> Search(string manifestation)
 
397
                public NameUri Search(string manifestation)
398
398
                {
399
 
                        if(string.Equals(_file_data_obj.Value, manifestation))
 
399
                        if(string.Equals(_file_data_obj.Uri, manifestation))
400
400
                           return _file_data_obj;
401
401
                        
402
 
                        if(string.Equals(_deleted_resc.Value, manifestation))
 
402
                        if(string.Equals(_deleted_resc.Uri, manifestation))
403
403
                           return _deleted_resc;
404
404
                        
405
 
                        KeyValuePair<string, string> embedded_file_data_obj = _embedded_file_data_obj.Search(manifestation);
406
 
                        if(embedded_file_data_obj.Key != null)
 
405
                        NameUri embedded_file_data_obj = _embedded_file_data_obj.Search(manifestation);
 
406
                        if(embedded_file_data_obj.Name != null)
407
407
                                return embedded_file_data_obj;
408
408
                        
409
 
                        if(string.Equals(_remote_data_obj.Value, manifestation))
 
409
                        if(string.Equals(_remote_data_obj.Uri, manifestation))
410
410
                           return _remote_data_obj;
411
411
                        
412
 
                        return new KeyValuePair<string, string>();
 
412
                        return new NameUri();
413
413
                }
414
414
                
415
415
                #region Private Fields
416
416
                
417
 
                private KeyValuePair<string, string> _file_data_obj = new KeyValuePair<string, string>("FileDataObject", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject");
 
417
                private NameUri _file_data_obj = new NameUri("FileDataObject", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject");
418
418
                
419
 
                private KeyValuePair<string, string> _deleted_resc = new KeyValuePair<string, string>("DeletedResource", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#DeletedResource");
 
419
                private NameUri _deleted_resc = new NameUri("DeletedResource", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#DeletedResource");
420
420
                
421
421
                private EmbeddedFileDataObjectType _embedded_file_data_obj = new EmbeddedFileDataObjectType();
422
422
                
423
 
                private KeyValuePair<string, string> _remote_data_obj = new KeyValuePair<string, string>("RemoteDataObject", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemoteDataObject");
 
423
                private NameUri _remote_data_obj = new NameUri("RemoteDataObject", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemoteDataObject");
424
424
                
425
425
                #endregion
426
426
        }
433
433
                /// <remarks>
434
434
                /// http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#EmbeddedFileDataObject
435
435
                /// </remarks>
436
 
                public KeyValuePair<string, string> EmbeddedFileDataObject
 
436
                public NameUri EmbeddedFileDataObject
437
437
                {
438
438
                        get
439
439
                        {
447
447
                /// <remarks>
448
448
                /// http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#ArchiveItem
449
449
                /// </remarks>
450
 
                public KeyValuePair<string, string> ArchiveItem
 
450
                public NameUri ArchiveItem
451
451
                {
452
452
                        get
453
453
                        {
461
461
                /// <remarks>
462
462
                /// http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Attachment
463
463
                /// </remarks>
464
 
                public KeyValuePair<string, string> Attachment
 
464
                public NameUri Attachment
465
465
                {
466
466
                        get
467
467
                        {
469
469
                        }
470
470
                }
471
471
                
472
 
                public KeyValuePair<string, string> Search(string manifestation)
 
472
                public NameUri Search(string manifestation)
473
473
                {
474
 
                        if(string.Equals(_embedded_file_data_obj.Value, manifestation))
 
474
                        if(string.Equals(_embedded_file_data_obj.Uri, manifestation))
475
475
                           return _embedded_file_data_obj;
476
476
                        
477
 
                        if(string.Equals(_archive_item.Value, manifestation))
 
477
                        if(string.Equals(_archive_item.Uri, manifestation))
478
478
                           return _archive_item;
479
479
                        
480
 
                        if(string.Equals(_attachment.Value, manifestation))
 
480
                        if(string.Equals(_attachment.Uri, manifestation))
481
481
                           return _attachment;
482
482
                        
483
 
                        return new KeyValuePair<string, string>();
 
483
                        return new NameUri();
484
484
                }
485
485
                
486
486
                #region Private Fields
487
487
                
488
 
                private KeyValuePair<string, string> _embedded_file_data_obj = new KeyValuePair<string, string>("EmbeddedFileDataObject", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#EmbeddedFileDataObject");
489
 
                
490
 
                private KeyValuePair<string, string> _archive_item = new KeyValuePair<string, string>("ArchiveItem", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#ArchiveItem");
491
 
                
492
 
                private KeyValuePair<string, string> _attachment = new KeyValuePair<string, string>("Attachment", "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Attachment");
 
488
                private NameUri _embedded_file_data_obj = new NameUri("EmbeddedFileDataObject", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#EmbeddedFileDataObject");
 
489
                
 
490
                private NameUri _archive_item = new NameUri("ArchiveItem", "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#ArchiveItem");
 
491
                
 
492
                private NameUri _attachment = new NameUri("Attachment", "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Attachment");
493
493
                
494
494
                #endregion
495
495
        }