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


UCC Code Repository

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 91 - (show annotations) (download)
Tue Oct 12 21:38:57 2010 UTC (11 years, 1 month ago) by rvvs89
File size: 2334 byte(s)
Right click on map markers now displays a context menu.
Metadata can now be deleted using the context menu.
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Drawing;
5 using System.Data;
6 using System.Text;
7 using System.Windows.Forms;
8 using ZoneFiveSoftware.Common.Data;
9
10 namespace MetadataPlugin.Source
11 {
12 public partial class AddMetadataControl : UserControl
13 {
14 private MetadataLocation location;
15 private Nullable<DateTime> point;
16 private Nullable<DateTime> range;
17
18 public AddMetadataControl()
19 {
20 InitializeComponent();
21 }
22
23 public MetadataLocation MetadataLocation
24 {
25 get { return location; }
26 set
27 {
28 location = value;
29 textRadioButton.Enabled = new List<MetadataLocation>(MetadataType.TEXT.ApplicableLocations).Contains(location);
30 textRadioButton.Checked = textRadioButton.Enabled;
31 }
32 }
33
34 public DateTime Point
35 {
36 get { return point.Value; }
37 set { point = value; }
38 }
39
40 public DateTime End
41 {
42 get { return range.Value; }
43 set { range = value; }
44 }
45
46 private void nextButton_Click(object sender, EventArgs e)
47 {
48 MetadataType type;
49 if (textRadioButton.Checked)
50 {
51 type = MetadataType.TEXT;
52 } else {
53 AddMetadataDialog.Instance.Close();
54 return;
55 }
56 IMetadata data = type.CreateInstance(MetadataLocation);
57 switch (MetadataLocation)
58 {
59 case MetadataLocation.POINT:
60 data.Point = Point;
61 break;
62 case MetadataLocation.RANGE:
63 data.Point = Point;
64 data.End = End;
65 break;
66 }
67 MetadataRouteControlLayer.Instances[0].CurrentList.Add(data);
68 EditMetadataDialog.Instance.Control.Editor = data.Editor;
69 EditMetadataDialog.Instance.Control.InitialEdit = true;
70 EditMetadataDialog.Instance.Control.UpdateContent();
71 AddMetadataDialog.Instance.Close();
72 EditMetadataDialog.Instance.ShowDialog();
73 }
74 }
75 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26