/[cits3200i]/branches/gps-running-clean-r116/HighScorePlugin/Plugin.cs


UCC Code Repository

Contents of /branches/gps-running-clean-r116/HighScorePlugin/Plugin.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5 - (show annotations) (download)
Sun Sep 5 15:48:34 2010 UTC (11 years, 3 months ago) by rvvs89
File size: 2517 byte(s)
Branching a local copy of the HEAD revision of the gps-running project on Google Code.
We will probably have to use this project as a template for our own plugins if we want to support SportTracks 2.1.
1 /*
2 Copyright (C) 2007, 2008 Kristian Bisgaard Lassen
3 Copyright (C) 2010 Kristian Helkjaer Lassen
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 3 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 using System;
20 using System.Collections.Generic;
21 using System.Text;
22 using System.Xml;
23
24 using ZoneFiveSoftware.Common.Visuals.Fitness;
25 using GpsRunningPlugin.Source;
26
27 namespace GpsRunningPlugin
28 {
29 class Plugin : IPlugin
30 {
31
32 #region IPlugin Members
33
34 public IApplication Application
35 {
36 set { application = value; }
37 }
38
39 public static IApplication GetApplication()
40 {
41 return application;
42 }
43
44 public Guid Id
45 {
46 get { return new Guid("{4B84E5C0-EC2B-4C0C-8B8E-3FAEB09F74C6}"); }
47 }
48
49 public string Name
50 {
51 get { return "High Score Plugin"; }
52 }
53
54 public string Version
55 {
56 get { return GetType().Assembly.GetName().Version.ToString(3); }
57 }
58
59 public void ReadOptions(XmlDocument xmlDoc, XmlNamespaceManager nsmgr, XmlElement pluginNode)
60 {
61 String attr;
62 attr = pluginNode.GetAttribute(xmlTags.Verbose);
63 if (attr.Length > 0) { Verbose = XmlConvert.ToInt16(attr); }
64
65 Settings.ReadOptions(xmlDoc, nsmgr, pluginNode);
66 }
67
68 public void WriteOptions(XmlDocument xmlDoc, XmlElement pluginNode)
69 {
70 pluginNode.SetAttribute(xmlTags.Verbose, XmlConvert.ToString(Verbose));
71 Settings.WriteOptions(xmlDoc, pluginNode);
72 }
73
74 #endregion
75
76 #region Private members
77 private class xmlTags
78 {
79 public const string Verbose = "Verbose";
80 }
81 private static IApplication application;
82 #endregion
83
84 public static int Verbose = 0; //Only changed in xml file
85 }
86 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26