Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SR.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 //
4 // ----------------------------------------------------------------------
5 // Gold Parser engine.
6 // See more details on http://www.devincook.com/goldparser/
7 //
8 // Original code is written in VB by Devin Cook (GOLDParser@DevinCook.com)
9 //
10 // This translation is done by Vladimir Morozov (vmoroz@hotmail.com)
11 //
12 // The translation is based on the other engine translations:
13 // Delphi engine by Alexandre Rai (riccio@gmx.at)
14 // C# engine by Marcus Klimstra (klimstra@home.nl)
15 // ----------------------------------------------------------------------
16 #region Using directives
17 
18 using System;
19 using System.IO;
20 using System.Resources;
21 using System.Globalization;
22 
23 #endregion
24 
25 namespace GoldParser
26 {
27  /// <summary>
28  /// Custom resource class. Usage:
29  /// string s = Res.GetString(Res.MyIdenfitier);
30  /// </summary>
31  internal sealed class SR
32  {
33  static SR ms_loader = new SR();
34 
35  private ResourceManager m_resources;
36 
37  private SR()
38  {
39  m_resources = new ResourceManager("GoldParser", this.GetType().Module.Assembly);
40  }
41 
42  /* These function can be useful in other applications.
43 
44  public static string GetString(string name, params object[] args)
45  {
46  // null CultureInfo: let ResouceManager determine the culture
47  return GetString(null, name, args);
48  }
49 
50  public static string GetString(CultureInfo culture, string name, params object[] args)
51  {
52  string res = ms_loader.m_resources.GetString(name, culture);
53 
54  if (args != null && args.Length > 0)
55  {
56  return String.Format(culture, res, args);
57  }
58  else
59  {
60  return res;
61  }
62  }
63 */
64  public static string GetString(string name)
65  {
66  return GetString(null, name);
67  }
68 
69  public static string GetString(CultureInfo culture, string name)
70  {
71  return ms_loader.m_resources.GetString(name, culture);
72  }
73 
74  // Code below is automatically generated by GenResNm.exe.
75  // Do not modify it manually.
76  #region Resource String Names
77 
78  internal const string Grammar_WrongFileHeader = "Grammar_WrongFileHeader";
79 
80  internal const string Grammar_InvalidRecordType = "Grammar_InvalidRecordType";
81 
82  internal const string Grammar_NoEntry = "Grammar_NoEntry";
83 
84  internal const string Grammar_EmptyEntryExpected = "Grammar_EmptyEntryExpected";
85 
86  internal const string Grammar_StringEntryExpected = "Grammar_StringEntryExpected";
87 
88  internal const string Grammar_IntegerEntryExpected = "Grammar_IntegerEntryExpected";
89 
90  internal const string Grammar_ByteEntryExpected = "Grammar_ByteEntryExpected";
91 
92  internal const string Grammar_BooleanEntryExpected = "Grammar_BooleanEntryExpected";
93 
94  internal const string Grammar_InvalidRecordHeader = "Grammar_InvalidRecordHeader";
95 
96  #endregion
97  }
98 }