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


UCC Code Repository

Contents of /trunk/UWAPlugins/MetadataPlugin/Source/EditMetadataDialog.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: 3020 byte(s)
Merging metadata-branch-rvvs89.
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Text;
7 using System.Windows.Forms;
8
9 namespace MetadataPlugin.Source
10 {
11 public partial class EditMetadataDialog : Form
12 {
13 private IMetadata data;
14 private static EditMetadataDialog instance;
15
16 public static EditMetadataDialog Instance
17 {
18 get { return instance; }
19 }
20
21 static EditMetadataDialog()
22 {
23 instance = new EditMetadataDialog();
24 }
25
26 public EditMetadataDialog()
27 {
28 InitializeComponent();
29 }
30
31 public EditMetadataControl Control
32 {
33 get { return control; }
34 }
35
36 public ContextMenuStrip MapMarkerContextMenu
37 {
38 get { return mapMarkerContextMenu; }
39 }
40
41 private void EditMetadataDialog_FormClosing(object sender, FormClosingEventArgs e)
42 {
43 if (control != null)
44 {
45 control.Cancel();
46 }
47 }
48
49 public IMetadata MapMarkerReference
50 {
51 set { data = value; }
52 }
53
54 private void confirmToolStripMenuItem_Click(object sender, EventArgs e)
55 {
56 MetadataRouteControlLayer.Instances[0].CurrentList.Remove(data);
57 }
58
59 private void modifyToolStripMenuItem_Click(object sender, EventArgs e)
60 {
61 MetadataRouteControlLayer.Instances[0].CurrentList.Edit(data);
62 }
63
64 private void selectReferencedLocationToolStripMenuItem_Click(object sender, EventArgs e)
65 {
66 MetadataRouteControlLayer.Instances[0].CurrentList.SelectRegion(data);
67 }
68
69 private void changeToEntireRouteToolStripMenuItem_Click(object sender, EventArgs e)
70 {
71 data.Location = MetadataLocation.TRACK;
72 MetadataRouteControlLayer.Instances[0].CurrentList.Invalidate(data);
73 }
74
75 private void moveToSelectedToolStripMenuItem_Click(object sender, EventArgs e)
76 {
77 DateTime start;
78 DateTime end;
79 MetadataRouteControlLayer.Instances[0].CalculateSelectedRegion(out start, out end);
80 if (start != end)
81 {
82 data.Location = MetadataLocation.RANGE;
83 data.Point = start;
84 data.End = end;
85 }
86 else
87 {
88 data.Location = MetadataLocation.POINT;
89 data.Point = start;
90 }
91 MetadataRouteControlLayer.Instances[0].CurrentList.Invalidate(data);
92 }
93
94 public bool SupportsTrackSelection
95 {
96 set { changeToEntireRouteToolStripMenuItem.Enabled = value; }
97 }
98
99 public bool SupportsSelectedRegion
100 {
101 set { moveToSelectedToolStripMenuItem.Enabled = value; }
102 }
103 }
104 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26