System.Resources.ResourceManager.GetString C# (CSharp) Method

GetString() public method

public GetString ( string name, CultureInfo culture ) : string
name string
culture CultureInfo
return string
        public virtual string GetString(string name, CultureInfo culture)
        {
            if (null == name)
            {
                throw new ArgumentNullException(nameof(name));
            }

            if (WinRTInterop.Callbacks.IsAppxModel() && _resourceMap == null)
            {
                if (name.Equals("MissingManifestResource_ResWFileNotLoaded") &&
                    _resourcesSubtree.Equals("FxResources.System.Resources.ResourceManager.SR", StringComparison.OrdinalIgnoreCase))
                {
                    // If we get here, means we are missing the resources even for the message MissingManifestResource_ResWFileNotLoaded
                    // it is important to throw the exception using the hardcoded message to prevent the stack overflow from occurring.
                    throw new MissingManifestResourceException("Unable to load resources for resource file " + _resourcesSubtree + ".");
                }
                throw new MissingManifestResourceException(SR.Format(SR.MissingManifestResource_ResWFileNotLoaded, _resourcesSubtree));
            }

            return GetResourceString(name, culture == null ? null : culture.Name);
        }
        

Same methods

ResourceManager::GetString ( string name ) : string

Usage Example

        public BasicAuthenticationCtrl()
        {
            try
            {
                this.Font = SystemFonts.MessageBoxFont;
                InitializeComponent();

                resourceManager = new ResourceManager("ESRI.ArcGIS.OSM.Editor.OSMFeatureInspectorStrings", this.GetType().Assembly);

                lblUserName.Text = resourceManager.GetString("OSMEditor_Authentication_UI_labelusername");
                lblPassword.Text = resourceManager.GetString("OSMEditor_Authentication_UI_labelpassword");

                txtUserName.LostFocus += new EventHandler(txtUserName_LostFocus);
                txtUserName.Refresh();
                txtPassword.LostFocus += new EventHandler(txtPassword_LostFocus);
                txtPassword.Refresh();

                m_password = String.Empty;
                m_username = String.Empty;

                this.Refresh();
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
                System.Diagnostics.Debug.WriteLine(ex.StackTrace);
            }
        }
All Usage Examples Of System.Resources.ResourceManager::GetString