/[cits3200i]/trunk/UWAPlugins/PlaybackPlugin/Source/PlaybackAction.cs


UCC Code Repository

Contents of /trunk/UWAPlugins/PlaybackPlugin/Source/PlaybackAction.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 19 - (show annotations) (download)
Sun Sep 12 07:20:38 2010 UTC (11 years, 2 months ago) by rvvs89
File size: 1693 byte(s)
Only enable the Playback Action when a single activity is selected.
1 using PlaybackPlugin.Properties;
2 using System;
3 using System.Collections.Generic;
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 PlaybackPlugin.Source
12 {
13 class PlaybackAction : IAction
14 {
15 private IActivity activity = null;
16 private IDailyActivityView view;
17
18 public PlaybackAction(IDailyActivityView view)
19 {
20 this.view = view;
21 }
22
23 public bool Enabled
24 {
25 get {
26 Refresh();
27 return activity != null;
28 }
29 }
30
31 public bool HasMenuArrow
32 {
33 get { return false; }
34 }
35
36 public Image Image
37 {
38 get { return Properties.Resources.PlayIcon16; }
39 }
40
41 public IList<string> MenuPath
42 {
43 get { return null; }
44 }
45
46 public void Refresh()
47 {
48 activity = CollectionUtils.GetSingleItemOfType<IActivity>(view.SelectionProvider.SelectedItems);
49 }
50
51 public void Run(System.Drawing.Rectangle rectButton)
52 {
53 PlaybackDialog control = new PlaybackDialog(activity);
54 control.Show();
55 }
56
57 public string Title
58 {
59 get { return Resources.PlaybackBannerText; }
60 }
61
62 public bool Visible
63 {
64 get { return true; }
65 }
66
67 public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
68 }
69 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26