/[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 98 - (show annotations) (download)
Wed Oct 13 01:09:10 2010 UTC (11 years, 1 month ago) by rvvs89
File size: 2058 byte(s)
Replace Crystal icons with ones made by Joel for licensing reasons.
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 using MetadataPlugin.Properties;
11
12 namespace MetadataPlugin.Source
13 {
14 class AddToRangeAction : IAction
15 {
16 private IActivity activity;
17 private IList<string> menuPath = new List<string> { "Metadata" };
18 private DateTime start;
19 private DateTime end;
20
21 public bool Enabled
22 {
23 get
24 {
25 Refresh();
26 return activity != null && start != end && start >= activity.StartTime;
27 }
28 }
29
30 public bool HasMenuArrow
31 {
32 get { return false; }
33 }
34
35 public Image Image
36 {
37 get { return Resources.AttachRange; }
38 }
39
40 public IList<string> MenuPath
41 {
42 get { return menuPath; }
43 }
44
45 public void Refresh()
46 {
47 activity = CollectionUtils.GetSingleItemOfType<IActivity>(MetadataActivityReportPages.View.SelectionProvider.SelectedItems);
48 MetadataRouteControlLayer.Instances[0].CalculateSelectedRegion(out start, out end);
49 }
50
51 public void Run(Rectangle rectButton)
52 {
53 AddMetadataDialog.Instance.Control.MetadataLocation = MetadataLocation.RANGE;
54 AddMetadataDialog.Instance.Control.Point = start;
55 AddMetadataDialog.Instance.Control.End = end;
56 AddMetadataDialog.Instance.ShowDialog();
57 }
58
59 public string Title
60 {
61 get { return "Add To Range"; }
62 }
63
64 public bool Visible
65 {
66 get { return true; }
67 }
68
69 #pragma warning disable 67
70 public event PropertyChangedEventHandler PropertyChanged;
71 #pragma warning restore 67
72 }
73 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26