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


UCC Code Repository

Contents of /trunk/UWAPlugins/MetadataPlugin/Source/MetadataFile.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: 2908 byte(s)
Merging metadata-branch-rvvs89.
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 namespace MetadataPlugin.Source
6 {
7 [Serializable]
8 public class MetadataFile : IMetadata
9 {
10 private MetadataLocation location;
11 private string name;
12 private MetadataFileData data;
13 private Nullable<DateTime> point;
14 private Nullable<DateTime> range;
15 [NonSerialized]
16 private object formData = null;
17 [NonSerialized]
18 private MetadataFileEditor editor = null;
19
20 public MetadataFile(MetadataLocation location)
21 {
22 this.location = location;
23 name = "Untitled file data";
24 data = new MetadataFileData();
25 data.Name = null;
26 data.Data = null;
27 }
28
29 public MetadataType Type
30 {
31 get { return MetadataType.FILE; }
32 }
33
34 public IMetadataEditor Editor
35 {
36 get
37 {
38 if (editor == null || editor.IsDisposed)
39 {
40 editor = new MetadataFileEditor(this);
41 }
42 return editor;
43 }
44 }
45
46 public MetadataLocation Location
47 {
48 get { return location; }
49 set
50 {
51 location = value;
52 Commit();
53 }
54 }
55
56 public string Name
57 {
58 get { return name; }
59 set
60 {
61 name = value;
62 Commit();
63 }
64 }
65
66 public MetadataFileData 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 [Serializable]
108 public class MetadataFileData
109 {
110 private string name;
111 private byte[] data;
112
113 public string Name
114 {
115 get { return name; }
116 set { name = value; }
117 }
118
119 public byte[] Data
120 {
121 get { return data; }
122 set { data = value; }
123 }
124 }
125 }
126 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26