2002-1-17 Duncan Mak <duncan@duncan@ximian.com>
authorDuncan Mak <duncan@mono-cvs.ximian.com>
Fri, 18 Jan 2002 00:17:08 +0000 (00:17 -0000)
committerDuncan Mak <duncan@mono-cvs.ximian.com>
Fri, 18 Jan 2002 00:17:08 +0000 (00:17 -0000)
       * *.cs: convert to Miguel's brace style.

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

mcs/class/corlib/System.Resources/ChangeLog
mcs/class/corlib/System.Resources/IResourceReader.cs
mcs/class/corlib/System.Resources/IResourceWriter.cs
mcs/class/corlib/System.Resources/MissingManifestResourceException.cs
mcs/class/corlib/System.Resources/NeutralResoucesLanguageAttribute.cs
mcs/class/corlib/System.Resources/ResourceManager.cs
mcs/class/corlib/System.Resources/ResourceReader.cs
mcs/class/corlib/System.Resources/ResourceSet.cs
mcs/class/corlib/System.Resources/ResourceWriter.cs
mcs/class/corlib/System.Resources/SatelliteContractVersionAttribute.cs

index b16fa4c242bf80da3faad018d5d0351c90f10ebd..cd3b217cc746255eee422925474cc3ebcdf10e26 100644 (file)
@@ -1,8 +1,10 @@
-2002-1-17  Duncan Mak  <duncan@192.168.10-120.masq>
+2002-1-17  Duncan Mak  <duncan@duncan@ximian.com>
 
        * ResourceSet.cs: Implemented GetObject (string, bool) and GetString
        (string, bool). ResourceSet has no more MonoTODOs! Also added in the
        Serializable attribute.
+       
+       * *.cs: convert to Miguel's brace style.
 
 2002-01-17  Duncan Mak  <duncan@ximian.com>
 
index a17e362a392e1d8d4d568dc759aa6fc426744df4..a714e2bc11317a6f5b1b793f8da1ba5640a53e62 100644 (file)
 using System;
 using System.Collections;
 
-namespace System.Resources {
+namespace System.Resources
+{
 
-          public interface IResourceReader : IEnumerable, IDisposable {
+          public interface IResourceReader : IEnumerable, IDisposable
+          {
                         void Close();
                         new IDictionaryEnumerator GetEnumerator();
           }
index f97bd90dfec1187e2c28c4f7fd0076320e42ecbf..e81b82efde7e7ec723c5f93cff31a8d4bfc580b0 100644 (file)
@@ -9,9 +9,11 @@
 
 using System;
 
-namespace System.Resources {
+namespace System.Resources
+{
 
-          public interface IResourceWriter : IDisposable {
+          public interface IResourceWriter : IDisposable
+          {
                         void AddResource (string name, byte[] value);
                         void AddResource (string name, object value);
                         void AddResource (string name, string value);
index 07ba6e236a8ee454ce5f8469073a316eb925813f..14953a6d62a748f9b1c07b2a55d86dde7620d96b 100644 (file)
 using System.Globalization;
 using System.Runtime.Serialization;
 
-namespace System.Resources {
+namespace System.Resources
+{
 
-          public class MissingManifestResourceException: Exception {
+          public class MissingManifestResourceException: Exception
+          {
                         private string param;
 
                         // Constructors
index 6837eb8e95c569dd09bcd1eacf31bdfdf0821e46..0c2c4da5bd1fa46b300f0e751e2c36a9b87972af 100644 (file)
@@ -7,17 +7,21 @@
 // (C) 2001 Ximian, Inc.               http://www.ximian.com
 //
 
-namespace System.Resources {
+namespace System.Resources
+{
           [AttributeUsage (AttributeTargets.Assembly)]
-          public sealed class NeutralResourcesLanguageAttribute : Attribute {
+          public sealed class NeutralResourcesLanguageAttribute : Attribute
+          {
 
                         string culture;
 
                         // Constructors
-                        public NeutralResourcesLanguageAttribute (string cultureName) {
+                        public NeutralResourcesLanguageAttribute (string cultureName)
+                        {
                                    culture = cultureName;
                         }
-                        public string CultureName {
+                        public string CultureName
+                        {
                                    get { return culture; }
                         }
           }
index 2652b8778b0a8c497811dd93d72b9d5730e677d3..8b95a52fe365eaae2382436056ff13bef12642ac 100644 (file)
@@ -11,10 +11,11 @@ using System.Collections;
 using System.Reflection;
 using System.Globalization;
 
-namespace System.Resources {
-
-         [Serializable]
-          public class ResourceManager {
+namespace System.Resources
+{
+          [Serializable]
+          public class ResourceManager
+          {
                         public static readonly int HeaderVersionNumber;
                         // public static readonly int MagicNumber = 0xBEEFCACE;
 
@@ -28,7 +29,8 @@ namespace System.Resources {
                         // constructors
                         public ResourceManager () {}
 
-                        public ResourceManager (Type resourceSource) {
+                        public ResourceManager (Type resourceSource)
+                        {
                                    if (resourceSource == null)
                                                  throw new ArgumentNullException ("resourceSource is null.");
 
@@ -39,7 +41,8 @@ namespace System.Resources {
                                    resourceSetType = resourceSource;
                         }
 
-                        public ResourceManager (string baseName, Assembly assembly) {
+                        public ResourceManager (string baseName, Assembly assembly)
+                        {
                                    if (baseName == null || assembly == null)
                                                  throw new ArgumentNullException ("The arguments are null.");
 
@@ -49,7 +52,8 @@ namespace System.Resources {
                                    resourceSetType = typeof (ResourceSet);
                         }
                         
-                        public ResourceManager (string baseName, Assembly assembly, Type usingResourceSet) {
+                        public ResourceManager (string baseName, Assembly assembly, Type usingResourceSet)
+                        {
                                    if (baseName == null || assembly == null)
                                                  throw new ArgumentNullException ("The arguments are null.");
 
@@ -68,32 +72,40 @@ namespace System.Resources {
                         [MonoTODO]
                         public static ResourceManager CreateFileBasedResourceManager (string baseName,
                                                                                                                           string resourceDir,
-                                                                                                                          Type usingResourceSet) {
+                                                                                                                          Type usingResourceSet)
+                        {
                                    return null;
                         }
 
-                        public virtual string BaseName { get { return BaseNameField; }}
+                        public virtual string BaseName
+                        {
+                                   get { return BaseNameField; }
+                        }
 
-                        public virtual bool IgnoreCase {
+                        public virtual bool IgnoreCase
+                        {
                                    get { return ignoreCase; }
                                    set { ignoreCase = value; }
                         }
 
-                        public virtual Type ResourceSetType {
+                        public virtual Type ResourceSetType
+                        {
                                        get { return resourceSetType; }
                         }
                         
                         [MonoTODO]
                         public virtual ResourceSet GetResourceSet (CultureInfo culture,
                                                                                            bool createIfNotExists,
-                                                                                           bool tryParents) {
+                                                                                           bool tryParents)
+                        {
                                    if (culture == null)
                                                  throw new ArgumentNullException ("CultureInfo is a null reference.");
                                return null;
                         }
 
                         [MonoTODO]
-                        public virtual string GetString (string name) {
+                        public virtual string GetString (string name)
+                        {
                                    if (name == null)
                                                  throw new ArgumentNullException ("Name is null.");
                                    if (ResourceSets.Contains (name)) {
@@ -106,29 +118,34 @@ namespace System.Resources {
                         }
 
                         [MonoTODO]
-                        public virtual string GetString (string name, CultureInfo culture) {
+                        public virtual string GetString (string name, CultureInfo culture)
+                        {
                                    if (name == null)
                                                  throw new ArgumentNullException ("Name is null.");
                                    return null;
                         }
 
-                        protected virtual string GetResourceFileName (CultureInfo culture) {
+                        protected virtual string GetResourceFileName (CultureInfo culture)
+                        {
                                    return culture.Name + ".resources";
                         }
 
                         [MonoTODO]
                         protected virtual ResourceSet InternalGetResourceSet (CultureInfo culture,
                                                                               bool Createifnotexists,
-                                                                              bool tryParents) {
+                                                                              bool tryParents)
+                        {
                                    return null;
                         }
                   
-                        public virtual void ReleaseAllResources () {
+                        public virtual void ReleaseAllResources ()
+                        {
                                    foreach (ResourceSet r in ResourceSets)
                                                  r.Close();
                         }
 
-                        protected static CultureInfo GetNeutralResourcesLanguage (Assembly a) {
+                        protected static CultureInfo GetNeutralResourcesLanguage (Assembly a)
+                        {
                                    foreach (Attribute attribute in a.GetCustomAttributes (false)) {
                                                  if (attribute is NeutralResourcesLanguageAttribute)
                                                                return new CultureInfo ((attribute as NeutralResourcesLanguageAttribute).CultureName);
@@ -136,7 +153,8 @@ namespace System.Resources {
                                    return null;
                         }
 
-                        protected 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);
index fc2ce176d9cd42157c043757290f0d952502af8b..e9b92ac3fe57ee7bee362fdbc28e4c20bba2fd44 100644 (file)
 using System.Collections;
 using System.IO;
 
-namespace System.Resources {
-       public sealed class ResoureReader : IResourceReader, IDisposable {
+namespace System.Resources
+{
+       public sealed class ResoureReader : IResourceReader, IDisposable
+       {
                Stream stream;
                
                // Constructors
@@ -59,30 +61,36 @@ namespace System.Resources {
                
        }
        
-       internal class DictionaryEnumerator : IDictionaryEnumerator {
+       internal class DictionaryEnumerator : IDictionaryEnumerator
+       {
                protected DictionaryEntry entry;
                protected object key;
                protected object value;
                
-               public DictionaryEntry Entry {
+               public DictionaryEntry Entry
+               {
                        get { return entry; }
                }
                
-               public object Key {
+               public object Key
+            {
                        get { return key; }
                }
                
-               public object Value {
+               public object Value
+               {
                        get { return value; }
                }
                
                [MonoTODO]
-               public object Current {
+               public object Current
+               {
                        get { return null; }
                }
                
                [MonoTODO]
-               public bool MoveNext () {
+               public bool MoveNext ()
+               {
                        return false;
                }
                
index 271259e350c134864c653ffd1a64082b943de2cc..e0c0bafff6f3b55bbb481c7ec765b0668a14bb0d 100644 (file)
 using System.Collections;
 using System.IO;
 
-namespace System.Resources {
+namespace System.Resources
+{
           
           [Serializable]
-          public class ResourceSet : IDisposable {
+          public class ResourceSet : IDisposable
+          {
 
                         protected IResourceReader Reader;
-                        protected ResourceHashtable Table;
+                        protected Hashtable Table;
                         
                         // Constructors
                         protected ResourceSet () {}
-                        protected ResourceSet (IResourceReader reader) {
+                        protected ResourceSet (IResourceReader reader)
+                        {
                                    if (reader == null)
                                                  throw new ArgumentNullException ("The reader is null.");
                                    Reader = reader;
                         }
 
-                        protected ResourceSet (Stream stream) {
+                        protected ResourceSet (Stream stream)
+                        {
                                    Reader = new ResourceReader (stream);
                         }
                         
-                        protected ResourceSet (String fileName) {
+                        protected ResourceSet (String fileName)
+                        {
                                    Reader = new ResourceReader (fileName);
                         }
 
-                        public virtual void Close () {
+                        public virtual void Close ()
+                        {
                                    Dispose (true);
                         }
 
-                        public void Dispose() {
+                        public void Dispose()
+                        {
                                    Dispose (true);
                         }
                         
-                        public void Dispose (bool disposing) {
+                        public void Dispose (bool disposing)
+                        {
                                    if (disposing) {
                                                  Reader = null;
                                                  Table = null;
                                    } 
                         }
                         
-                        public virtual Type GetDefaultReader () {
+                        public virtual Type GetDefaultReader ()
+                        {
                                    return (typeof (ResourceReader));
                         } 
-                        public virtual Type GetDefaultWriter () {
+                        public virtual Type GetDefaultWriter ()
+                        {
                                    return (typeof (ResourceWriter));
                         }
 
-                        public virtual object GetObject (string name) {
+                        public virtual object GetObject (string name)
+                        {
                                    if (name == null)
                                                  throw new ArgumentNullException ("The name parameter is null.");
                                    if (Reader == null)
@@ -67,48 +78,45 @@ namespace System.Resources {
                                    }
                                    if (Table != null)
                                                  return Table[name];
-                                   return null;
                         }
 
-                        public virtual object GetObject (string name, bool ignoreCase) {
+                        public virtual object GetObject (string name, bool ignoreCase)
+                        {
                                    if (name == null)
                                                  throw new ArgumentNullException ("The name parameter is null.");
                                    if (Reader == null)
                                                  throw new InvalidOperationException ("ResourceSet has been closed.");
                                    if (Table == null)
                                                  ReadResources ();
-                                   
-                                   if (Table != null && ignoreCase == false)
-                                                 return Table[name];
-
                                    if (ignoreCase) {
-                                                 IComparer c = new CaseInsensitiveComparer ();
-                                                 Table.comparer (c);
-                                                 return Table[name];
-                                   }
-                                   
-                                   else {  // Comparer is the default, case sensitive
-                                                 IComparer c = new Comparer ();
-                                                 Table.comparer (c);
-                                                 return Table[name];
-                                   }
+                                                 foreach (DictionaryEntry de in Table) {
+                                                               string key = (string) de.Key;
+
+                                                               if (String.Compare (key, name, true))
+                                                                          return de.Value;
+                                                 }
+                                   } else
+                                                 return Table[name]
                         }
 
-                        public virtual string GetString (string name) {
+                        public virtual string GetString (string name)
+                        {
                                    Object o = GetObject (name);
                                    if (o is string)
                                                  return (string) o;
                                    return null;
                         }
 
-                        public virtual string GetString (string name, bool ignoreCase) {
+                        public virtual string GetString (string name, bool ignoreCase)
+                        {
                                    Object o = GetObject (name, ignoreCase);
                                    if (o is string)
                                                  return (string) o;
                                    return null;
                         }
 
-                        public virtual void ReadResources () {
+                        public virtual void ReadResources ()
+                        {
                                    IDictionaryEnumerator i = Reader.GetEnumerator();
 
                                    if (Table == null)
@@ -119,6 +127,5 @@ namespace System.Resources {
                                                  Table.Add (i.Key, i.Value);
                         }
           }
-          public class ResourceHashtable : Hashtable {}
 }
 
index 3a32d76263efb1fb1ec59a889ef6501007c03b47..08ae121e1c6b89564b23ee3af1d576dd8e4c6cb3 100644 (file)
@@ -9,11 +9,13 @@
 
 using System.IO;
 
-namespace System.Resources {
-          public sealed class ResourceWriter : IResourceWriter {
-
+namespace System.Resources
+{
+          public sealed class ResourceWriter : IResourceWriter
+          {
                         [MonoTODO]
-                        public ResourceWriter (Stream stream) {
+                        public ResourceWriter (Stream stream)
+                        {
                                    if (stream == null)
                                                  throw new ArgumentNullException ("stream is null");
                                    if (stream.CanWrite == false)
@@ -21,32 +23,37 @@ namespace System.Resources {
                         }
 
                         [MonoTODO]
-                        public ResourceWriter (String fileName) {
+                        public ResourceWriter (String fileName)
+                        {
                                    if (fileName == null)
                                                  throw new ArgumentNullException ("fileName is null.");
                         }
 
                         [MonoTODO]
-                        public void AddResource (string name, byte[] value) {
+                        public void AddResource (string name, byte[] value)
+                        {
                                    if (name == null || value == null)
                                                  throw new ArgumentNullException ("Parameter is a null reference.");
                         }
 
                         [MonoTODO]
-                        public void AddResource (string name, object value) {
+                        public void AddResource (string name, object value)
+                        {
                                    if (name == null || value == null)
                                                  throw new ArgumentNullException ("Parameter is a null reference.");
                         }
 
                         [MonoTODO]
-                        public void AddResource (string name, string value) {
+                        public void AddResource (string name, string value)
+                        {
                                    if (name == null || value == null)
                                                  throw new ArgumentNullException ("Parameter is a null reference.");
                         }
                                    
                         public void Close () {}
                         
-                        public void Dispose () {
+                        public void Dispose ()
+                        {
                                    Close();
                         }
 
index c5cf7234e2ad60b073243e6b6481d65d5994dd7f..8727d7b32fc94bd855a76e859a351c1ce00dad89 100644 (file)
@@ -7,18 +7,20 @@
 // (C) 2001 Ximian, Inc.               http://www.ximian.com
 //
 
-namespace System.Resources {
-          
+namespace System.Resources
+{
           [AttributeUsage (AttributeTargets.Assembly)]
-          public sealed class SatelliteContractVersionAttribute : Attribute {
-
+          public sealed class SatelliteContractVersionAttribute : Attribute
+          {
                         private Version ver; 
 
                         // Constructor
-                        public SatelliteContractVersionAttribute (string version) {
+                        public SatelliteContractVersionAttribute (string version)
+                        {
                                    ver = new Version(version);
                         }
-                        public string Version {
+                        public string Version
+                        {
                                    get { return ver.ToString(); }
                         }
           }