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


UCC Code Repository

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 95 - (show annotations) (download)
Tue Oct 12 23:23:36 2010 UTC (11 years, 1 month ago) by rvvs89
File size: 2864 byte(s)
Adding stubs for file attachment metadata.
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 namespace MetadataPlugin.Source
6 {
7 public class MetadataFile : IMetadata
8 {
9 private MetadataLocation location;
10 private string name;
11 private MetadataFileData data;
12 private Nullable<DateTime> point;
13 private Nullable<DateTime> range;
14 [NonSerialized]
15 private object formData = null;
16 [NonSerialized]
17 private MetadataFileEditor editor = null;
18
19 public MetadataFile(MetadataLocation location)
20 {
21 this.location = location;
22 name = "Untitled file data";
23 data = new MetadataFileData();
24 data.Name = null;
25 data.Data = null;
26 }
27
28 public MetadataType Type
29 {
30 get { return MetadataType.FILE; }
31 }
32
33 public IMetadataEditor Editor
34 {
35 get
36 {
37 if (editor == null || editor.IsDisposed)
38 {
39 editor = new MetadataFileEditor(this);
40 }
41 return editor;
42 }
43 }
44
45 public MetadataLocation Location
46 {
47 get { return location; }
48 set
49 {
50 location = value;
51 Commit();
52 }
53 }
54
55 public string Name
56 {
57 get { return name; }
58 set
59 {
60 name = value;
61 Commit();
62 }
63 }
64
65 public MetadataFileData Data
66 {
67 get { return data; }
68 set
69 {
70 data = value;
71 Commit();
72 }
73 }
74
75 public DateTime Point
76 {
77 get { return point.Value; }
78 set
79 {
80 point = value;
81 Commit();
82 }
83 }
84
85 public DateTime End
86 {
87 get { return range.Value; }
88 set
89 {
90 range = value;
91 Commit();
92 }
93 }
94
95 public object FormData
96 {
97 get { return formData; }
98 set { formData = value; }
99 }
100
101 public void Commit()
102 {
103 MetadataRouteControlLayer.Instances[0].CurrentList.Commit();
104 }
105
106 public class MetadataFileData
107 {
108 private string name;
109 private byte[] data;
110
111 public string Name
112 {
113 get { return name; }
114 set { name = value; }
115 }
116
117 public byte[] Data
118 {
119 get { return data; }
120 set { data = value; }
121 }
122 }
123 }
124 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26