Author: mkrueger
Date: 2007-07-05 07:15:41 -0400 (Thu, 05 Jul 2007)
New Revision: 81384

Modified:
   trunk/monodevelop/Core/src/MonoDevelop.Core/ChangeLog
   
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/CharacterEncodings.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/StringParserService.cs
Log:
* MonoDevelop.Core.Properties/CharacterEncodings.cs,
  MonoDevelop.Core/StringParserService.cs: Removed some commented out
  code.

Modified: trunk/monodevelop/Core/src/MonoDevelop.Core/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Core/ChangeLog       2007-07-05 
11:09:58 UTC (rev 81383)
+++ trunk/monodevelop/Core/src/MonoDevelop.Core/ChangeLog       2007-07-05 
11:15:41 UTC (rev 81384)
@@ -1,5 +1,11 @@
 2007-07-05  Mike Krüger <[EMAIL PROTECTED]> 
 
+       * MonoDevelop.Core.Properties/CharacterEncodings.cs,
+         MonoDevelop.Core/StringParserService.cs: Removed some commented out
+         code.
+
+2007-07-05  Mike Krüger <[EMAIL PROTECTED]> 
+
        * MonoDevelop.Core.Execution/ProcessService.cs,
          MonoDevelop.Core.ProgressMonitoring/ProgressTracker.cs,
          MonoDevelop.Core.ProgressMonitoring/AggregatedOperationMonitor.cs,

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/StringParserService.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/StringParserService.cs
 2007-07-05 11:09:58 UTC (rev 81383)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/StringParserService.cs
 2007-07-05 11:15:41 UTC (rev 81384)
@@ -106,8 +106,8 @@
                                                }
                                        }
                                        
-                                       if (propertyValue == null) {
-                                               propertyValue = 
properties[propertyName.ToUpper()];
+                                       if (propertyValue == null && 
properties.ContainsKey (propertyName.ToUpper())) {
+                                               propertyValue = properties 
[propertyName.ToUpper()];
                                        }
                                        
                                        if (propertyValue == null) {
@@ -183,55 +183,4 @@
                        return sb.ToString ();
                }
        }
-       /*
-       public class PropertyDictionary : DictionaryBase
-       {
-               /// <summary>
-               /// Maintains a list of the property names that are readonly.
-               /// </summary>
-               StringCollection readOnlyProperties = new StringCollection();
-               
-               /// <summary>
-               /// Adds a property that cannot be changed.
-               /// </summary>
-               /// <remarks>
-               /// Properties added with this method can never be changed.  
Note that
-               /// they are removed if the <c>Clear</c> method is called.
-               /// </remarks>
-               /// <param name="name">Name of property</param>
-               /// <param name="value">Value of property</param>
-               public void AddReadOnly(string name, string value) 
-               {
-                       if (!readOnlyProperties.Contains(name)) {
-                               readOnlyProperties.Add(name);
-                               Dictionary.Add(name, value);
-                       }
-               }
-               
-               /// <summary>
-               /// Adds a property to the collection.
-               /// </summary>
-               /// <param name="name">Name of property</param>
-               /// <param name="value">Value of property</param>
-               public void Add(string name, string value) 
-               {
-                       if (!readOnlyProperties.Contains(name)) {
-                               Dictionary.Add(name, value);
-                       }
-               }
-               
-               public string this[string name] {
-                       get { 
-                               return 
(string)Dictionary[(object)name.ToUpper()];
-                       }
-                       set {
-                               Dictionary[name.ToUpper()] = value;
-                       }
-               }
-               
-               protected override void OnClear() 
-               {
-                       readOnlyProperties.Clear();
-               }
-       }*/
 }

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/CharacterEncodings.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/CharacterEncodings.cs
       2007-07-05 11:09:58 UTC (rev 81383)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/CharacterEncodings.cs
       2007-07-05 11:15:41 UTC (rev 81384)
@@ -234,13 +234,9 @@
                        return GetEncodingByIndex(GetEncodingIndex(cp));
                }
                
-               public static int GetEncodingIndex(int cp) {
-                       try {
-                               return (Int32)_cp2index[cp];
-                       }
-                       catch {
-                               return -1;
-                       }
+               public static int GetEncodingIndex(int cp) 
+               {
+                       return _cp2index.ContainsKey (cp) ? _cp2index[cp] : -1;
                }
 
                public static int GetCodePageByIndex(int i) {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to