Mercurial > repos > IBBoard
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 |
rev | line source |
---|---|
16 | 1 // This file (Constants.cs) is a part of the IBBoard library and is copyright 2009 IBBoard. |
2 // | |
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. | |
4 | |
37 | 5 using System; |
6 using System.IO; | |
7 | |
8 namespace IBBoard | |
9 { | |
10 /// <summary> | |
11 /// Summary description for Constants. | |
12 /// </summary> | |
13 public class Constants | |
14 { | |
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 | 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 | 51 } |
52 } |