[Mono-dev] Re: [Mono-patches] r55711 -trunk/mcs/class/System.Web/System.Web.UI
Konstantin Triger
kostat at mainsoft.com
Tue Jan 24 08:43:17 EST 2006
Please review the reworked patch.
Regards,
Konstantin Triger
-----Original Message-----
From: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Ben
Maurer
Sent: Sunday, January 22, 2006 9:58 PM
To: mono-devel-list at lists.ximian.com
Subject: [Mono-dev] Re: [Mono-patches] r55711
-trunk/mcs/class/System.Web/System.Web.UI
Hey,
I think this patch adds more bytes than needed to the serialization. An
easy way of saving a few bytes would be to make Empty a sort of known
color. So if the known color that was written out was 0, we would then
write an additional byte to disambig. between known color 0 and empty.
-- Ben
On Wed, 2006-01-18 at 03:57 -0500, Konstantin Triger
(kostat at mainsoft.com) wrote:
> Author: kostat
> Date: 2006-01-18 03:57:28 -0500 (Wed, 18 Jan 2006)
> New Revision: 55711
>
> Modified:
> trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
> trunk/mcs/class/System.Web/System.Web.UI/ObjectStateFormatter.cs
> Log:
> preserve emptiness in ColorFormatter
>
> Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
> ===================================================================
> --- trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
2006-01-18 08:51:22 UTC (rev 55710)
> +++ trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
2006-01-18 08:57:28 UTC (rev 55711)
> @@ -1,5 +1,9 @@
> 2006-01-18 Konstantin Triger <kostat at mainsoft.com>
>
> + * ObjectStateFormatter.cs: preserve emptiness in ColorFormatter.
> +
> +2006-01-18 Konstantin Triger <kostat at mainsoft.com>
> +
> * HtmlTextWriter.cs: perform case insensitive compare;
> return correct key in default case.
>
>
> Modified:
trunk/mcs/class/System.Web/System.Web.UI/ObjectStateFormatter.cs
> ===================================================================
> --- trunk/mcs/class/System.Web/System.Web.UI/ObjectStateFormatter.cs
2006-01-18 08:51:22 UTC (rev 55710)
> +++ trunk/mcs/class/System.Web/System.Web.UI/ObjectStateFormatter.cs
2006-01-18 08:57:28 UTC (rev 55711)
> @@ -663,19 +663,24 @@
>
> if (!c.IsKnownColor) {
> w.Write (PrimaryId);
> - w.Write (c.ToArgb ());
> + w.Write(c.IsEmpty);
> + if (!c.IsEmpty)
> + w.Write (c.ToArgb ());
> } else {
> w.Write (SecondaryId);
> - w.Write ((int) c.ToKnownColor
());
> + w.Write(c.IsEmpty);
> + if (!c.IsEmpty)
> + w.Write ((int)
c.ToKnownColor ());
> }
> }
>
> protected override object Read (byte token,
BinaryReader r, ReaderContext ctx)
> {
> + bool isEmpty = r.ReadBoolean();
> if (token == PrimaryId)
> - return Color.FromArgb
(r.ReadInt32 ());
> + return isEmpty ? Color.Empty :
Color.FromArgb (r.ReadInt32 ());
> else
> - return Color.FromKnownColor
((KnownColor) r.ReadInt32 ());
> + return isEmpty ? Color.Empty :
Color.FromKnownColor ((KnownColor) r.ReadInt32 ());
> }
>
> protected override Type Type {
>
> _______________________________________________
> Mono-patches maillist - Mono-patches at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-patches
>
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ObjectStateFormatter.cs.save.patch
Type: application/octet-stream
Size: 1341 bytes
Desc: ObjectStateFormatter.cs.save.patch
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060124/0425fc88/attachment.obj
More information about the Mono-devel-list
mailing list