annotate Constants.cs @ 108:27b6aa1e98e8

Re #12: Document classes and methods * Document the Constants (Also - test new Hg repo and hooks)
author IBBoard <dev@ibboard.co.uk>
date Sun, 14 Aug 2011 14:34:12 +0100
parents 0f88d32b22cc
children e9f3a4ddf772
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
0352fa33ee8f Closes #8 - license code
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
1 // This file (Constants.cs) is a part of the IBBoard library and is copyright 2009 IBBoard.
0352fa33ee8f Closes #8 - license code
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
2 //
0352fa33ee8f Closes #8 - license code
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
3 // The file and the library/program it is in are licensed under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING.LGPL for more information and the full license.
0352fa33ee8f Closes #8 - license code
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
4
37
cc7fae81afec * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
5 using System;
cc7fae81afec * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
6 using System.IO;
cc7fae81afec * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
7
cc7fae81afec * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
8 namespace IBBoard
cc7fae81afec * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
9 {
cc7fae81afec * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
10 /// <summary>
cc7fae81afec * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
11 /// Summary description for Constants.
cc7fae81afec * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
12 /// </summary>
cc7fae81afec * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
13 public class Constants
cc7fae81afec * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
14 {
cc7fae81afec * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
15 public static readonly char DirectoryChar = Path.DirectorySeparatorChar;
0
961030992bd2 Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 public static readonly string DirectoryString = Path.DirectorySeparatorChar.ToString();
961030992bd2 Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 private static string executablePath = AppDomain.CurrentDomain.BaseDirectory.TrimEnd(DirectoryChar);
961030992bd2 Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18
961030992bd2 Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 static Constants()
37
cc7fae81afec * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
20 {
107
0f88d32b22cc * Swap to built-in .Net methods (listed on http://www.ironshay.com/post/Use-NET-Built-in-Methods-to-Save-Time-and-Headaches.aspx)
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
21 string appDataDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
0f88d32b22cc * Swap to built-in .Net methods (listed on http://www.ironshay.com/post/Use-NET-Built-in-Methods-to-Save-Time-and-Headaches.aspx)
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
22 string exe = Environment.GetCommandLineArgs()[0];
0f88d32b22cc * Swap to built-in .Net methods (listed on http://www.ironshay.com/post/Use-NET-Built-in-Methods-to-Save-Time-and-Headaches.aspx)
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
23 exe = Path.GetFileNameWithoutExtension(exe);
0f88d32b22cc * Swap to built-in .Net methods (listed on http://www.ironshay.com/post/Use-NET-Built-in-Methods-to-Save-Time-and-Headaches.aspx)
IBBoard <dev@ibboard.co.uk>
parents: 37
diff changeset
24 userDataPath = Path.Combine(Path.Combine(appDataDir, "IBBoard"), exe);
0
961030992bd2 Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25 }
961030992bd2 Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
26
108
27b6aa1e98e8 Re #12: Document classes and methods
IBBoard <dev@ibboard.co.uk>
parents: 107
diff changeset
27 /// <summary>
27b6aa1e98e8 Re #12: Document classes and methods
IBBoard <dev@ibboard.co.uk>
parents: 107
diff changeset
28 /// Gets the path of the directory that contains the executable.
27b6aa1e98e8 Re #12: Document classes and methods
IBBoard <dev@ibboard.co.uk>
parents: 107
diff changeset
29 /// </summary>
27b6aa1e98e8 Re #12: Document classes and methods
IBBoard <dev@ibboard.co.uk>
parents: 107
diff changeset
30 /// <value>
27b6aa1e98e8 Re #12: Document classes and methods
IBBoard <dev@ibboard.co.uk>
parents: 107
diff changeset
31 /// The path that the executable is in.
27b6aa1e98e8 Re #12: Document classes and methods
IBBoard <dev@ibboard.co.uk>
parents: 107
diff changeset
32 /// </value>
0
961030992bd2 Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33 public static string ExecutablePath
961030992bd2 Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 {
961030992bd2 Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35 get { return executablePath; }
961030992bd2 Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
36 }
961030992bd2 Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
37
961030992bd2 Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
38 private static string userDataPath;
108
27b6aa1e98e8 Re #12: Document classes and methods
IBBoard <dev@ibboard.co.uk>
parents: 107
diff changeset
39
27b6aa1e98e8 Re #12: Document classes and methods
IBBoard <dev@ibboard.co.uk>
parents: 107
diff changeset
40 /// <summary>
27b6aa1e98e8 Re #12: Document classes and methods
IBBoard <dev@ibboard.co.uk>
parents: 107
diff changeset
41 /// Gets the standard user data path for this app. This follows a convention of using the app name for the folder
27b6aa1e98e8 Re #12: Document classes and methods
IBBoard <dev@ibboard.co.uk>
parents: 107
diff changeset
42 /// and putting it in a folder called "IBBoard" to avoid collisions.
27b6aa1e98e8 Re #12: Document classes and methods
IBBoard <dev@ibboard.co.uk>
parents: 107
diff changeset
43 /// </summary>
27b6aa1e98e8 Re #12: Document classes and methods
IBBoard <dev@ibboard.co.uk>
parents: 107
diff changeset
44 /// <value>
27b6aa1e98e8 Re #12: Document classes and methods
IBBoard <dev@ibboard.co.uk>
parents: 107
diff changeset
45 /// The user data path, following the IBBoard convention.
27b6aa1e98e8 Re #12: Document classes and methods
IBBoard <dev@ibboard.co.uk>
parents: 107
diff changeset
46 /// </value>
0
961030992bd2 Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
47 public static string UserDataPath
961030992bd2 Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
48 {
961030992bd2 Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
49 get { return userDataPath; }
961030992bd2 Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
50 }
37
cc7fae81afec * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
51 }
cc7fae81afec * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
52 }