/[cits3200i]/trunk/UWAPlugins/MetadataPlugin/Source/MetadataType.cs


UCC Code Repository

Contents of /trunk/UWAPlugins/MetadataPlugin/Source/MetadataType.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 100 - (show annotations) (download)
Wed Oct 13 01:51:32 2010 UTC (11 years, 1 month ago) by rvvs89
File size: 2196 byte(s)
Merging metadata-branch-rvvs89.
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using System.Windows.Forms;
5
6 namespace MetadataPlugin.Source
7 {
8 public abstract class MetadataType
9 {
10 public abstract string Name { get; }
11
12 public abstract IEnumerable<MetadataLocation> ApplicableLocations { get; }
13
14 public abstract IMetadata CreateInstance(MetadataLocation location);
15
16 public static readonly MetadataType TEXT = new MetadataTextType();
17
18 public static readonly MetadataType FILE = new MetadataFileType();
19
20 public static IEnumerable<MetadataType> Values
21 {
22 get
23 {
24 yield return TEXT;
25 yield return FILE;
26 }
27 }
28
29
30 [Serializable]
31 class MetadataTextType : MetadataType
32 {
33 public override string Name
34 {
35 get { return "Text"; }
36 }
37
38 public override IEnumerable<MetadataLocation> ApplicableLocations
39 {
40 get
41 {
42 yield return MetadataLocation.POINT;
43 yield return MetadataLocation.RANGE;
44 yield return MetadataLocation.TRACK;
45 }
46 }
47
48 public override IMetadata CreateInstance(MetadataLocation location)
49 {
50 return new MetadataText(location);
51 }
52 }
53
54 [Serializable]
55 class MetadataFileType : MetadataType
56 {
57 public override string Name
58 {
59 get { return "File"; }
60 }
61
62 public override IEnumerable<MetadataLocation> ApplicableLocations
63 {
64 get
65 {
66 yield return MetadataLocation.POINT;
67 yield return MetadataLocation.RANGE;
68 yield return MetadataLocation.TRACK;
69 }
70 }
71
72 public override IMetadata CreateInstance(MetadataLocation location)
73 {
74 return new MetadataFile(location);
75 }
76 }
77 }
78 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26