2002-01-17 Duncan Mak <duncan@ximian.com>
authorDuncan Mak <duncan@mono-cvs.ximian.com>
Thu, 17 Jan 2002 18:51:34 +0000 (18:51 -0000)
committerDuncan Mak <duncan@mono-cvs.ximian.com>
Thu, 17 Jan 2002 18:51:34 +0000 (18:51 -0000)
    * ResourceManager.cs: Fixed GetNeutralResourcesLanguage () and added
      new attributes documented in 1.0 SDK.

svn path=/trunk/mcs/; revision=2024

mcs/class/corlib/System.Resources/ChangeLog
mcs/class/corlib/System.Resources/ResourceManager.cs

index 624dc5a482e0eb73d344d0d98e111ab35d70a502..4e7dd2d4069421251b3eddae1efb91fdb447d2f2 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-17  Duncan Mak  <duncan@ximian.com>
+
+       * ResourceManager.cs: Fixed GetNeutralResourcesLanguage () and added
+       new attributes documented in 1.0 SDK.
+
 2002-01-17  Duncan Mak  <duncan@ximian.com>
 
        * ResourceWriter.cs: Added MonoTODO decorations.
index 0dd750c60e53349498737ed17653487c79d1e47d..2652b8778b0a8c497811dd93d72b9d5730e677d3 100644 (file)
@@ -12,9 +12,11 @@ using System.Reflection;
 using System.Globalization;
 
 namespace System.Resources {
+
+         [Serializable]
           public class ResourceManager {
                         public static readonly int HeaderVersionNumber;
-                  // public static readonly int MagicNumber = 0xBEEFCACE;
+                        // public static readonly int MagicNumber = 0xBEEFCACE;
 
                         protected string BaseNameField;
                         protected Assembly MainAssembly;
@@ -110,9 +112,8 @@ namespace System.Resources {
                                    return null;
                         }
 
-                        [MonoTODO]
                         protected virtual string GetResourceFileName (CultureInfo culture) {
-                                   return culture.Name + ".resources"; // TODO check for correctness.
+                                   return culture.Name + ".resources";
                         }
 
                         [MonoTODO]
@@ -127,16 +128,15 @@ namespace System.Resources {
                                                  r.Close();
                         }
 
-                        [MonoTODO]
                         protected static CultureInfo GetNeutralResourcesLanguage (Assembly a) {
                                    foreach (Attribute attribute in a.GetCustomAttributes (false)) {
-//                                               if (attribute is NeutralResourcesLanguageAttribute)
-//                                                             return new CultureInfo (attribute.CultureName);
+                                                 if (attribute is NeutralResourcesLanguageAttribute)
+                                                               return new CultureInfo ((attribute as NeutralResourcesLanguageAttribute).CultureName);
                                    }
                                    return null;
                         }
 
-                        public static Version GetSatelliteContractVersion (Assembly a) {
+                        protected static Version GetSatelliteContractVersion (Assembly a) {
                                    foreach (Attribute attribute in a.GetCustomAttributes (false)) {
                                                  if (attribute is SatelliteContractVersionAttribute)
                                                                return new Version ((attribute as SatelliteContractVersionAttribute).Version);