/[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 86 - (show annotations) (download)
Mon Oct 11 06:42:56 2010 UTC (11 years, 1 month ago) by rvvs89
File size: 1543 byte(s)
Committing partially implemented Metadata plugin.
Couldn't finish it before the meeting :(
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using System.Windows.Forms;
5
6 namespace MetadataPlugin.Source
7 {
8 abstract class MetadataType
9 {
10 public abstract string Name { get; }
11
12 public abstract Form CreateEditor();
13
14 public abstract IEnumerable<MetadataLocation> ApplicableLocations { get; }
15
16 public abstract IMetadata CreateInstance(MetadataLocation location);
17
18 public static readonly MetadataType TEXT = new MetadataTextType();
19
20 public static IEnumerable<MetadataType> Values
21 {
22 get
23 {
24 yield return TEXT;
25 }
26 }
27
28
29 [Serializable]
30 class MetadataTextType : MetadataType
31 {
32 public override string Name
33 {
34 get { return "Text"; }
35 }
36
37 public override IEnumerable<MetadataLocation> ApplicableLocations
38 {
39 get
40 {
41 yield return MetadataLocation.POINT;
42 yield return MetadataLocation.RANGE;
43 yield return MetadataLocation.TRACK;
44 }
45 }
46
47 public override IMetadata CreateInstance(MetadataLocation location)
48 {
49 return new MetadataText(location);
50 }
51
52 public override Form CreateEditor()
53 {
54 throw new NotImplementedException();
55 }
56 }
57 }
58 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26