show the difference between two versions for a specified path
[tfs.git] / tools / tfsbot / AppSettings.cs
blob80d27e362b4f862e8bb8d21a0e512909ca6d45cb
1 using System;
2 using System.Collections;
3 using System.Collections.Generic;
4 using System.Collections.Specialized;
5 using System.Configuration;
6 using System.Net;
7 using System.Text;
8 using System.Threading;
10 static class AppSettings
12 static private string ircServer;
13 static private string tfsUrl;
14 static private string commandChannel;
15 static private string notifyChannel;
16 static private string username;
17 static private string password;
18 static private string domain;
19 static private string nick;
20 static private int latestChangesetId = 0;
22 static public string IrcServer
24 get { return ircServer; }
27 static public string Nick
29 get { return nick; }
32 static public string TfsUrl
34 get { return tfsUrl; }
37 static public string CommandChannel
39 get { return commandChannel; }
42 static public string NotifyChannel
44 get { return notifyChannel; }
47 static public string Username
49 get { return username; }
52 static public string Password
54 get { return password; }
57 static public string Domain
59 get { return domain; }
62 static public int LatestChangesetId
64 get { return latestChangesetId; }
67 static AppSettings()
69 // Get the AppSettings collection.
70 NameValueCollection appSettings = ConfigurationManager.AppSettings;
71 string[] keys = appSettings.AllKeys;
73 // Loop to get key/value pairs.
74 for (int i = 0; i < appSettings.Count; i++)
76 switch (keys[i])
78 case "irc.server":
79 ircServer = appSettings[i];
80 break;
81 case "irc.channel.notify":
82 notifyChannel = appSettings[i];
83 break;
84 case "irc.channel.command":
85 commandChannel = appSettings[i];
86 break;
87 case "irc.channel": //obsolete setting
88 commandChannel = appSettings[i];
89 notifyChannel = appSettings[i];
90 break;
91 case "irc.nick":
92 nick = appSettings[i];
93 break;
94 case "tfs.url":
95 tfsUrl = appSettings[i];
96 break;
97 case "tfs.domain":
98 domain = appSettings[i];
99 break;
100 case "tfs.username":
101 username = appSettings[i];
102 break;
103 case "tfs.password":
104 password = appSettings[i];
105 break;
106 case "tfs.changeset":
107 string cid = appSettings[i];
108 if (!String.IsNullOrEmpty(cid))
109 latestChangesetId = Convert.ToInt32(cid);
110 break;