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


UCC Code Repository

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 90 - (show annotations) (download)
Tue Oct 12 21:18:41 2010 UTC (11 years, 1 month ago) by rvvs89
File size: 2187 byte(s)
Attaching metadata now works.
Saving metadata now works.
Loading metadata now works.
Editing metadata and cancelling your changes now works.
MetadataList now only commits on change.
Icons appear on the track when metadata is added.
Icons can be double clicked to launch the editor.
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using ZoneFiveSoftware.Common.Data;
5
6 namespace MetadataPlugin.Source
7 {
8 [Serializable]
9 class MetadataText : IMetadata
10 {
11 private MetadataLocation location;
12 private string name;
13 private string data;
14 private Nullable<DateTime> point;
15 private Nullable<DateTime> range;
16 [NonSerialized]
17 private object formData = null;
18 [NonSerialized]
19 private MetadataTextEditor editor = null;
20
21 public MetadataText(MetadataLocation location)
22 {
23 this.location = location;
24 name = "Untitled text data";
25 data = "Enter your data here";
26 }
27
28 public MetadataType Type
29 {
30 get { return MetadataType.TEXT; }
31 }
32
33 public MetadataLocation Location
34 {
35 get { return location; }
36 set { location = value; }
37 }
38
39
40 public string Name
41 {
42 get { return name; }
43 set
44 {
45 name = value;
46 MetadataRouteControlLayer.Instances[0].CurrentList.Commit();
47 }
48 }
49
50 public IMetadataEditor Editor
51 {
52 get
53 {
54 if (editor == null || editor.IsDisposed)
55 {
56 editor = new MetadataTextEditor(this);
57 }
58 return editor;
59 }
60 }
61
62 public string Data
63 {
64 get { return data; }
65 set
66 {
67 data = value;
68 MetadataRouteControlLayer.Instances[0].CurrentList.Commit();
69 }
70 }
71
72 public DateTime Point
73 {
74 get { return point.Value; }
75 set { point = value; }
76 }
77
78 public DateTime End
79 {
80 get { return range.Value; }
81 set { range = value; }
82 }
83
84 public object FormData
85 {
86 get { return formData; }
87 set { formData = value; }
88 }
89 }
90 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26