Author: krasnov
Date: 2007-06-24 05:24:25 -0400 (Sun, 24 Jun 2007)
New Revision: 80617

Modified:
   trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI/ObjectStateFormatter.cs
Log:
* ObjectStateFormatter.cs: WriterContext.RegisterCache, refactored out parameter

Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/ChangeLog  2007-06-24 09:21:05 UTC 
(rev 80616)
+++ trunk/mcs/class/System.Web/System.Web.UI/ChangeLog  2007-06-24 09:24:25 UTC 
(rev 80617)
@@ -1,3 +1,8 @@
+2007-06-24  Vladimir Krasnov  <[EMAIL PROTECTED]>
+
+       * ObjectStateFormatter.cs: WriterContext.RegisterCache, refactored out
+       parameter
+
 2007-06-20  Marek Habersack  <[EMAIL PROTECTED]>
 
        * BasePartialCachingControl.cs: use HttpRuntime.InternalCache to

Modified: trunk/mcs/class/System.Web/System.Web.UI/ObjectStateFormatter.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/ObjectStateFormatter.cs    
2007-06-24 09:21:05 UTC (rev 80616)
+++ trunk/mcs/class/System.Web/System.Web.UI/ObjectStateFormatter.cs    
2007-06-24 09:24:25 UTC (rev 80617)
@@ -256,9 +256,15 @@
                class WriterContext {
                        Hashtable cache;
                        short nextKey = 0;
-                       
-                       public bool RegisterCache (object o, out short key)
+                       short key = 0;
+
+                       public short Key
                        {
+                               get { return key; }
+                       }
+
+                       public bool RegisterCache (object o)
+                       {
                                if (cache == null) {
                                        cache = new Hashtable ();
                                        cache.Add (o, key = nextKey++);
@@ -472,10 +478,9 @@
                class StringFormatter : ObjectFormatter {
                        protected override void Write (BinaryWriter w, object 
o, WriterContext ctx)
                        {
-                               short key;
-                               if (ctx.RegisterCache (o, out key)) {
+                               if (ctx.RegisterCache (o)) {
                                        w.Write (SecondaryId);
-                                       w.Write (key);
+                                       w.Write (ctx.Key);
                                } else {
                                        w.Write (PrimaryId);
                                        w.Write ((string)o);
@@ -837,10 +842,9 @@
                class TypeFormatter : ObjectFormatter {
                        protected override void Write (BinaryWriter w, object 
o, WriterContext ctx)
                        {
-                               short key;
-                               if (ctx.RegisterCache (o, out key)) {
+                               if (ctx.RegisterCache (o)) {
                                        w.Write (SecondaryId);
-                                       w.Write (key);
+                                       w.Write (ctx.Key);
                                } else {
                                        w.Write (PrimaryId);
                                        w.Write (((Type) o).FullName);

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

Reply via email to