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


UCC Code Repository

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62 - (show annotations) (download)
Thu Sep 30 03:22:02 2010 UTC (11 years, 2 months ago) by rvvs89
File size: 2755 byte(s)
Merging branch back into trunk.
1 using System;
2 using System.Collections.Generic;
3 using System.Drawing;
4 using System.IO;
5 using System.Text;
6 using ZoneFiveSoftware.Common.Data.GPS;
7 using ZoneFiveSoftware.Common.Visuals.Fitness;
8 using ZoneFiveSoftware.Common.Visuals.Mapping;
9
10 namespace PlaybackPlugin.Source
11 {
12 class PlaybackAnimationRouteControlLayer : IRouteControlLayer
13 {
14 private static IList<PlaybackAnimationRouteControlLayer> instances = new List<PlaybackAnimationRouteControlLayer>(3);
15 private IRouteControlLayerProvider provider;
16 private IRouteControl control;
17 private MapMarker startMarker;
18 private MapMarker endMarker;
19 private IList<IMapOverlay> overlays = new List<IMapOverlay>(2);
20
21 public MapMarker StartMarker
22 {
23 get { return startMarker; }
24 }
25
26 public MapMarker EndMarker
27 {
28 get { return endMarker; }
29 }
30
31 public PlaybackAnimationRouteControlLayer(IRouteControlLayerProvider provider, IRouteControl control)
32 {
33 this.provider = provider;
34 this.control = control;
35 startMarker = new MapMarker(new GPSPoint(0.0f, 0.0f, 0.0f), MakeMapIcon("PlaybackPlugin\\Data\\start.png", new Size(16, 16)), false);
36 startMarker.Visible = false;
37 overlays.Add(startMarker);
38 endMarker = new MapMarker(new GPSPoint(0.0f, 0.0f, 0.0f), MakeMapIcon("PlaybackPlugin\\Data\\stop.png", new Size(16, 16)), false);
39 endMarker.Visible = false;
40 overlays.Add(endMarker);
41 control.MapControl.AddOverlays(overlays);
42 instances.Add(this);
43
44 }
45
46 public void UpdateMarkers()
47 {
48 control.MapControl.RemoveOverlays(overlays);
49 control.MapControl.AddOverlays(overlays);
50 }
51
52 private MapIcon MakeMapIcon(string name, Size size)
53 {
54 string testPath = Plugin.Instance.Application.Configuration.CommonPluginsInstalledFolder + "\\" + Plugin.Instance.Id.ToString("D") + "\\" + name;
55 if (File.Exists(testPath))
56 {
57 return new MapIcon(testPath, size, new Point(size.Width / 2, size.Height / 2));
58 }
59 return null;
60 }
61
62 public static IList<PlaybackAnimationRouteControlLayer> Instances
63 {
64 get { return instances; }
65 }
66
67 public IRouteControlLayerProvider Provider
68 {
69 get { return provider; }
70 }
71
72 public int ZOrder
73 {
74 get { return 0; }
75 }
76
77 public IRouteControl Control
78 {
79 get { return control; }
80 }
81 }
82 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26