Author: alanmc
Date: 2008-02-09 20:28:42 -0500 (Sat, 09 Feb 2008)
New Revision: 95349

Modified:
   trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/Settings/TorrentSettings.cs
Log:
Default constructor correctly sets default values. Changed 
ArgumentNullException -> ArgumentOutOfRangeException. That was a typo.

Modified: 
trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/Settings/TorrentSettings.cs
===================================================================
--- 
trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/Settings/TorrentSettings.cs   
    2008-02-10 01:28:19 UTC (rev 95348)
+++ 
trunk/bitsharp/src/MonoTorrent/MonoTorrent.Client/Settings/TorrentSettings.cs   
    2008-02-10 01:28:42 UTC (rev 95349)
@@ -93,7 +93,7 @@
             set
             {
                 if (value < 2)
-                    throw new ArgumentNullException("You must use at least 2 
upload slots");
+                    throw new ArgumentOutOfRangeException("You must use at 
least 2 upload slots");
                 this.uploadSlots = value;
             }
         }
@@ -145,6 +145,7 @@
 
         #region Constructors
         public TorrentSettings()
+            : this(DefaultUploadSlots, DefaultMaxConnections, 
DefaultDownloadSpeed, DefaultUploadSpeed, DefaultFastResumeEnabled)
         {
         }
 
@@ -195,33 +196,20 @@
         }
         #endregion
 
+        #region Methods
 
-        #region Default Settings
-
-        /// <summary>
-        /// Creates a new instance of the Default settings. 
-        /// </summary>
-        public static TorrentSettings DefaultSettings()
+        object ICloneable.Clone()
         {
-            return new TorrentSettings(DefaultUploadSlots,
-                                       DefaultMaxConnections,
-                                       DefaultDownloadSpeed,
-                                       DefaultUploadSpeed,
-                                       DefaultFastResumeEnabled);
+            return Clone();
         }
 
-        #endregion
-        
-
-        #region Methods
-
-        public object Clone()
+        public TorrentSettings Clone()
         {
-            return new TorrentSettings(this.uploadSlots, 
-                                       this.maxConnections,
-                                       this.MaxDownloadSpeed,
-                                       this.maxUploadSpeed,
-                                       this.fastResumeEnabled);
+            return new TorrentSettings(this.uploadSlots,
+                           this.maxConnections,
+                           this.MaxDownloadSpeed,
+                           this.maxUploadSpeed,
+                           this.fastResumeEnabled);
         }
 
         public override bool Equals(object obj)

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

Reply via email to