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


UCC Code Repository

Contents of /branches/metadata-branch-rvvs89/UWAPlugins/MetadataPlugin/Source/AddToRangeAction.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: 2007 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 AddToRangeAction : 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.RANGE;
53 AddMetadataDialog.Instance.Control.Point = start;
54 AddMetadataDialog.Instance.Control.End = end;
55 AddMetadataDialog.Instance.ShowDialog();
56 }
57
58 public string Title
59 {
60 get { return "Add To Range"; }
61 }
62
63 public bool Visible
64 {
65 get { return true; }
66 }
67
68 #pragma warning disable 67
69 public event PropertyChangedEventHandler PropertyChanged;
70 #pragma warning restore 67
71 }
72 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26