aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Culture.cs
diff options
context:
space:
mode:
authorUbitUmarov2018-10-06 23:42:24 +0100
committerUbitUmarov2018-10-06 23:47:56 +0100
commiteb5fe57a17ada01885fbc5bb5ea543d109dab7ec (patch)
treeb5ad4b3018e39ed3074e59bfff7e35bf5ce1d837 /OpenSim/Framework/Culture.cs
parentmantis 8384: try to fix bullet heimap managed memory sharing with unmanaged lib (diff)
downloadopensim-SC-eb5fe57a17ada01885fbc5bb5ea543d109dab7ec.zip
opensim-SC-eb5fe57a17ada01885fbc5bb5ea543d109dab7ec.tar.gz
opensim-SC-eb5fe57a17ada01885fbc5bb5ea543d109dab7ec.tar.bz2
opensim-SC-eb5fe57a17ada01885fbc5bb5ea543d109dab7ec.tar.xz
more use of simpler xml encoder on inventory fetch, plus other cosmetics
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Culture.cs67
1 files changed, 1 insertions, 66 deletions
diff --git a/OpenSim/Framework/Culture.cs b/OpenSim/Framework/Culture.cs
index 1a44660..483f735 100644
--- a/OpenSim/Framework/Culture.cs
+++ b/OpenSim/Framework/Culture.cs
@@ -1,66 +1 @@
1/* /* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the OpenSimulator Project nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using System; using System.Globalization; using System.Threading; namespace OpenSim.Framework { public class Culture { private static readonly CultureInfo m_cultureInfo = new CultureInfo("en-US", false); public static NumberFormatInfo NumberFormatInfo { get { return m_cultureInfo.NumberFormat; } } public static IFormatProvider FormatProvider { get { return m_cultureInfo; } } /// <summary> /// Set Culture to en-US to make string processing of numbers simpler. /// </summary> public static void SetCurrentCulture() { Thread.CurrentThread.CurrentCulture = m_cultureInfo; } public static void SetDefaultCurrentCulture() { CultureInfo.DefaultThreadCurrentCulture = m_cultureInfo; } public static CultureInfo GetDefaultCurrentCulture() { return CultureInfo.DefaultThreadCurrentCulture; } } } \ No newline at end of file
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Globalization;
30using System.Threading;
31
32namespace OpenSim.Framework
33{
34 public class Culture
35 {
36 private static readonly CultureInfo m_cultureInfo = new CultureInfo("en-US", false);
37
38 public static NumberFormatInfo NumberFormatInfo
39 {
40 get { return m_cultureInfo.NumberFormat; }
41 }
42
43 public static IFormatProvider FormatProvider
44 {
45 get { return m_cultureInfo; }
46 }
47
48 /// <summary>
49 /// Set Culture to en-US to make string processing of numbers simpler.
50 /// </summary>
51 public static void SetCurrentCulture()
52 {
53 Thread.CurrentThread.CurrentCulture = m_cultureInfo;
54 }
55
56 public static void SetDefaultCurrentCulture()
57 {
58 CultureInfo.DefaultThreadCurrentCulture = m_cultureInfo;
59 }
60
61 public static CultureInfo GetDefaultCurrentCulture()
62 {
63 return CultureInfo.DefaultThreadCurrentCulture;
64 }
65 }
66} \ No newline at end of file