Microsoft.Cci.ErrorMessage.GetMessage C# (CSharp) Method

GetMessage() protected method

Obtains a localized message from the given resource manager and formats it using the message arguments associated with this error message. If no localized message corresponds to the message key of this message, the invariant culture is used. If no message corresponding to this error can be found then the message key itself is returned.
protected GetMessage ( System rm ) : string
rm System A resource manager corresponding to the current locale.
return string
    protected string GetMessage(System.Resources.ResourceManager rm) {
      Contract.Requires(rm != null);

      string/*?*/ localizedString = null;
      try {
        localizedString = rm.GetString(this.messageKey);
      } catch (System.Resources.MissingManifestResourceException) {
#if !COMPACTFX
      } catch (System.Resources.MissingSatelliteAssemblyException) {
#endif
      }
      try {
        if (localizedString == null)
          localizedString = rm.GetString(this.messageKey, System.Globalization.CultureInfo.InvariantCulture);
      } catch (System.Resources.MissingManifestResourceException) {
      }
      if (localizedString == null) localizedString = this.messageKey;
      if (this.messageArguments.Length == 0) return localizedString;
      try {
        return string.Format(localizedString, this.messageArguments);
      } catch (FormatException) {
        return localizedString;
      }
    }