Hi, For ShouldSerializeColorDepth and ShouldSerializeImageSize I get the behavior that I previously implemented: The result depends on whether the image list is empty.
See the removed code and the comments as well: http://svn.myrealbox.com/viewcvs/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ImageList.cs?rev=69012&r1=68807&r2=69012 For empty image lists these properties are serialized for non-empty image lists these properties are not serialized. Could you please test for this behavior as well? Kornél ----- Original Message ----- From: "Chris Toshok" <[EMAIL PROTECTED]> To: "Kornél Pál" <[EMAIL PROTECTED]> Cc: "Greg Creme" <[EMAIL PROTECTED]>; <[email protected]> Sent: Wednesday, December 06, 2006 5:27 PM Subject: Re: [Mono-winforms-list] Private ImageList methods removed inr69012 > visual c# express always generates assignments in the designer code for > ImageLists for ColorDepth and ImageSize, so clearly it's not making > calls to ShouldSerialize* for those properties (or they always return > true.. regardless, we don't need them in that case.) > > You are right about transparentcolor - there's no way to reset it, but > ShouldSerializeTransparentColor obviously returns false when the color > is LightGray, because the assignment disappears from the output in that > case. > > So I think the best/most compatible course of action is to implement > ShouldSerializeTransparentColor (and do so in an MS compatible way, > commenting it, as opposed to fixing it and documenting the difference) > but the other methods are unnecessary. > > Chris > > On Wed, 2006-12-06 at 16:43 +0100, Kornél Pál wrote: >> Hi, >> >> I got some weird results (I used Visual Studio 2005): >> Private Reset... methods are ignored but private ShouldSerialize... >> methods >> are used. >> >> Previously I didn't realize this behavior. >> >> Note ShouldSerialize... does not affect the property browser but affects >> the >> designer generated code and it is definitely affected by private >> ShouldSerialize... methods. >> >> Previosuly I added this comment: >> // MS.NET 2.0 initializes TransparentColor to Color.Transparent in >> // constructors but ResetTransparentColor and >> ShouldSerializeTransparentColor >> // default to Color.LightGray that is treated as a bug. >> >> But now that .NET Framework 2.0 is already released and this wasn't fixed >> we >> should follow MS.NET behavior if we reintroduce the remove methods. >> >> The private Reset... methods are ignored by Visual Studio and I'm not >> sure >> whether we should implement them: >> - Implementing them is good because it provides consistency with >> ShouldSerialize... that follows the specification >> (http://msdn2.microsoft.com/en-us/library/53b8022e.aspx) and other >> designers >> can use it and future Visual Studio versions may use it. >> - Implementing them is useless because they are not used. >> >> I think we should implement ShouldSerialize... methods because they are >> used. >> >> Kornél >> >> ----- Original Message ----- >> From: "Greg Creme" <[EMAIL PROTECTED]> >> To: "'Chris Toshok'" <[EMAIL PROTECTED]>; "'Kornél Pál'" >> <[EMAIL PROTECTED]> >> Cc: <[email protected]> >> Sent: Wednesday, December 06, 2006 3:59 PM >> Subject: RE: [Mono-winforms-list] Private ImageList methods removed in >> r69012 >> >> >> Hi Chris, >> >> I had a minute so I did what you asked in vs2003. >> >> For the imagelist properties: >> 1. Color Depth: >> Initial: Property name is not bold, property value is not bold, >> reset disabled. >> Changed: Property name is not bold, property value becomes bold, >> reset is enabled. >> >> 2. ImageSize and Transparent Color (both act the same) >> Initial: Property name is not bold, property value is bold, reset >> disabled. >> Changed: Property name is not bold, property value is bold, reset >> disabled. >> >> Hope this helps. >> >> Thanks, >> Greg >> >> -----Original Message----- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf Of Chris >> Toshok >> Sent: Wednesday, December 06, 2006 9:47 AM >> To: Kornél Pál >> Cc: [email protected] >> Subject: Re: [Mono-winforms-list] Private ImageList methods removed in >> r69012 >> >> so I just brought up visual c# express (which is admittedly 2.0) and >> none of the image list properties affected (ColorDepth, ImageSize, >> TransparentColor) acted as if they had a Reset or ShouldSerialize >> method. >> >> from that article, an easy way to determine this is: >> >> 1. select the ImageList in the design surface. >> >> 2. Look at its properties. If a property is in bold, it doesn't have a >> ShouldSerialize method (and also doesn't have a DefaultValue attribute, >> but that's irrelevant here). >> >> 3. change the value of the property, then right click on it. If the >> "Reset" item in the menu is disabled ,the property lacks a Reset method >> (and also lacks a DefaultValue attribute, but again that's irrelevant). >> >> in all three cases, the property was bold at the start, and the reset >> menu item was never enabled. Would someone mind doing the above 3 steps >> on those three properties inside vs2003? >> >> are these methods used in another context outside of designers? If not, >> I'd say removing them was the right change. If they're needed in 1.1 >> I'll add them back in ifdefed for 1.1 and make them internal instead of >> private to keep the warnings down. >> >> Chris >> >> On Wed, 2006-12-06 at 09:24 -0500, Chris Toshok wrote: >> > do we know that the designer in visual studio behaves as if it can call >> > these methods? The designers of course have to use reflection to find >> > the methods, but in the other cases these methods aren't private. If >> > visual studio behaves as if the methods are there, we have another >> > piece >> > (besides the msdn docs and corcompare output) we need to look at to see >> > which methods needs implementing. >> > >> > Chris >> > >> > On Wed, 2006-12-06 at 14:37 +0100, Kornél Pál wrote: >> > > Hi, >> > > >> > > The removed methods were private but they were intended to be used by >> > > designers. >> > > >> > > This feauture is documented: >> > > http://msdn2.microsoft.com/en-us/library/53b8022e.aspx >> > > >> > > Also note that I noticed the behavior in Visual Studio designer that >> > > can >> >> > > only be implemented using these methods. >> > > >> > > And I belive that it is legal to call these methods using reflection >> > > and >> >> > > study their behavior altough it wasn't necessary. >> > > >> > > Applications should not rely on the presence or absence of these >> > > methods >> if >> > > they are private but a properly implemented designer (or maybe other >> > > applications) can call these methods and the absence of these methods >> will >> > > result in different designer behavior regarding the default property >> values. >> > > >> > > Kornél >> > > >> > > _______________________________________________ >> > > Mono-winforms-list maillist - [email protected] >> > > http://lists.ximian.com/mailman/listinfo/mono-winforms-list >> > >> > _______________________________________________ >> > Mono-winforms-list maillist - [email protected] >> > http://lists.ximian.com/mailman/listinfo/mono-winforms-list >> >> _______________________________________________ >> Mono-winforms-list maillist - [email protected] >> http://lists.ximian.com/mailman/listinfo/mono-winforms-list >> > _______________________________________________ Mono-winforms-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-winforms-list
