// RM.cs // // Giuseppe Greco // Copyright (C) 2005 Agamura, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Giuseppe Greco (giuseppe.greco@agamura.com) using System.Resources; using System.Globalization; namespace NAnt.Core { /// /// Provides resource support to NAnt assemblies. This class cannot /// be inherited. /// internal sealed class RM { #region private fields private const string AssemblyName = "NAnt.Core"; private static ResourceManager resourceManager; #endregion private fields #region public methods /// /// Returns the value of the specified string resource. /// /// /// A that contains the name of the resource /// to get. /// /// /// A that contains the value of the resource /// localized for the current culture. /// public static string GetString(string name) { return GetString(name, null); } /// /// Returns the value of the specified string resource localized for the /// specified culture. /// /// /// A that contains the name of the resource /// to get. /// /// /// A that represents the /// culture for which the resource is localized. /// /// /// A that contains the value of the resource /// localized for the specified culture. /// public static string GetString(string name, CultureInfo culture) { if (resourceManager == null) { lock (typeof(RM)) { if (resourceManager == null) { resourceManager = new ResourceManager( AssemblyName, (typeof(RM)).Assembly); } } } return resourceManager.GetString(name, culture); } #endregion public methods } }