/[cits3200i]/branches/metadata-branch-rvvs89/UWAPlugins/MetadataPlugin/Source/MetadataType.cs


UCC Code Repository

Contents of /branches/metadata-branch-rvvs89/UWAPlugins/MetadataPlugin/Source/MetadataType.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 88 - (show annotations) (download)
Tue Oct 12 04:54:08 2010 UTC (11 years, 1 month ago) by rvvs89
File size: 1417 byte(s)
Syncing.
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 IEnumerable<MetadataType> Values
19 {
20 get
21 {
22 yield return TEXT;
23 // TODO: add more metadata types
24 }
25 }
26
27
28 [Serializable]
29 class MetadataTextType : MetadataType
30 {
31 public override string Name
32 {
33 get { return "Text"; }
34 }
35
36 public override IEnumerable<MetadataLocation> ApplicableLocations
37 {
38 get
39 {
40 yield return MetadataLocation.POINT;
41 yield return MetadataLocation.RANGE;
42 yield return MetadataLocation.TRACK;
43 }
44 }
45
46 public override IMetadata CreateInstance(MetadataLocation location)
47 {
48 return new MetadataText(location);
49 }
50 }
51 }
52 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26