diff options
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Framework/Console/ConsoleBase.cs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs index aab920b..22ce880 100755 --- a/OpenSim/Framework/Console/ConsoleBase.cs +++ b/OpenSim/Framework/Console/ConsoleBase.cs | |||
@@ -89,6 +89,57 @@ namespace OpenSim.Framework.Console | |||
89 | 89 | ||
90 | return ret; | 90 | return ret; |
91 | } | 91 | } |
92 | |||
93 | public string CmdPrompt(string p, List<char> excludedCharacters) | ||
94 | { | ||
95 | bool itisdone = false; | ||
96 | string ret = String.Empty; | ||
97 | while (!itisdone) | ||
98 | { | ||
99 | itisdone = true; | ||
100 | ret = CmdPrompt(p); | ||
101 | |||
102 | foreach (char c in excludedCharacters) | ||
103 | { | ||
104 | if (ret.Contains(c.ToString())) | ||
105 | { | ||
106 | System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted."); | ||
107 | itisdone = false; | ||
108 | } | ||
109 | } | ||
110 | } | ||
111 | |||
112 | return ret; | ||
113 | } | ||
114 | |||
115 | public string CmdPrompt(string p, string def, List<char> excludedCharacters) | ||
116 | { | ||
117 | bool itisdone = false; | ||
118 | string ret = String.Empty; | ||
119 | while (!itisdone) | ||
120 | { | ||
121 | itisdone = true; | ||
122 | ret = CmdPrompt(p, def); | ||
123 | |||
124 | if (ret == String.Empty) | ||
125 | { | ||
126 | ret = def; | ||
127 | } | ||
128 | else | ||
129 | { | ||
130 | foreach (char c in excludedCharacters) | ||
131 | { | ||
132 | if (ret.Contains(c.ToString())) | ||
133 | { | ||
134 | System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted."); | ||
135 | itisdone = false; | ||
136 | } | ||
137 | } | ||
138 | } | ||
139 | } | ||
140 | |||
141 | return ret; | ||
142 | } | ||
92 | 143 | ||
93 | // Displays a command prompt and returns a default value, user may only enter 1 of 2 options | 144 | // Displays a command prompt and returns a default value, user may only enter 1 of 2 options |
94 | public string CmdPrompt(string prompt, string defaultresponse, List<string> options) | 145 | public string CmdPrompt(string prompt, string defaultresponse, List<string> options) |