/[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 92 - (show annotations) (download)
Tue Oct 12 22:01:08 2010 UTC (11 years, 1 month ago) by rvvs89
File size: 2422 byte(s)
Added conditions to IActions to ensure that points/ranges are only addable when a point/range is selected.
Fixed metadata deletion not triggeting MetadataList commit.
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
37 {
38 location = value;
39 Commit();
40 }
41 }
42
43
44 public string Name
45 {
46 get { return name; }
47 set
48 {
49 name = value;
50 Commit();
51 }
52 }
53
54 public IMetadataEditor Editor
55 {
56 get
57 {
58 if (editor == null || editor.IsDisposed)
59 {
60 editor = new MetadataTextEditor(this);
61 }
62 return editor;
63 }
64 }
65
66 public string Data
67 {
68 get { return data; }
69 set
70 {
71 data = value;
72 Commit();
73 }
74 }
75
76 public DateTime Point
77 {
78 get { return point.Value; }
79 set
80 {
81 point = value;
82 Commit();
83 }
84 }
85
86 public DateTime End
87 {
88 get { return range.Value; }
89 set
90 {
91 range = value;
92 Commit();
93 }
94 }
95
96 public object FormData
97 {
98 get { return formData; }
99 set { formData = value; }
100 }
101
102 public void Commit()
103 {
104 MetadataRouteControlLayer.Instances[0].CurrentList.Commit();
105 }
106 }
107 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26