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


UCC Code Repository

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 94 - (show annotations) (download)
Tue Oct 12 22:55:25 2010 UTC (11 years, 1 month ago) by rvvs89
File size: 1948 byte(s)
Context menu can now move metadata to the selected point/region or the entire track.
Metadata management is almost fully usable now.
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Drawing;
5 using System.Text;
6 using ZoneFiveSoftware.Common.Data.Fitness;
7 using ZoneFiveSoftware.Common.Visuals;
8 using ZoneFiveSoftware.Common.Visuals.Fitness;
9 using ZoneFiveSoftware.Common.Visuals.Util;
10
11 namespace MetadataPlugin.Source
12 {
13 class AddToPointAction : IAction
14 {
15 private IActivity activity;
16 private IList<string> menuPath = new List<string> { "Metadata" };
17 private DateTime start;
18 private DateTime end;
19
20 public bool Enabled
21 {
22 get
23 {
24 Refresh();
25 return activity != null && start == end && start >= activity.StartTime;
26 }
27 }
28
29 public bool HasMenuArrow
30 {
31 get { return false; }
32 }
33
34 public Image Image
35 {
36 get { return null; }
37 }
38
39 public IList<string> MenuPath
40 {
41 get { return menuPath; }
42 }
43
44 public void Refresh()
45 {
46 activity = CollectionUtils.GetSingleItemOfType<IActivity>(MetadataActivityReportPages.View.SelectionProvider.SelectedItems);
47 MetadataRouteControlLayer.Instances[0].CalculateSelectedRegion(out start, out end);
48 }
49
50 public void Run(Rectangle rectButton)
51 {
52 AddMetadataDialog.Instance.Control.MetadataLocation = MetadataLocation.POINT;
53 AddMetadataDialog.Instance.Control.Point = start;
54 AddMetadataDialog.Instance.ShowDialog();
55 }
56
57 public string Title
58 {
59 get { return "Add To Point"; }
60 }
61
62 public bool Visible
63 {
64 get { return true; }
65 }
66
67 #pragma warning disable 67
68 public event PropertyChangedEventHandler PropertyChanged;
69 #pragma warning restore 67
70 }
71 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26