I can't see where your Padding and PaddingConverter is declared. Are you
talking about DockPadding? For complex types, you should be using
ShouldSerialize<PropertyName> and Reset<PropertyName> methods...
Thanks. Padding is a .NET 2 class, PaddingConverter is its (internal)
TypeConverter.
> I can't see where your Padding and PaddingConverter is declared. Are you
> talking about DockPadding? For complex types, you should be using
[quoted text clipped - 12 lines]
> > Thanks,
> > Juan
joeycalisay - 17 Dec 2004 01:59 GMT
Whidbey again, no time to test it yet. Anyway, i've read that they're
changing the shouldserialize<propertyname> method to
shouldpersist<propertyname> in 2.0
> Thanks. Padding is a .NET 2 class, PaddingConverter is its (internal)
> TypeConverter.
[quoted text clipped - 16 lines]
> > > Thanks,
> > > Juan
Joey,
Can you elaborate on the signature of the Reset<PropertyName> methods I
should implement? Also, any url to a sample or documentation would be
appreciated. The following doesn't seem to work:
[Category("Layout")]
[DefaultValue(typeof(Padding), "1, 3, 3, 0")]
public new Padding Padding
{
get
{
return padding;
}
set
{
padding = value;
base.Padding = padding;
}
}
private Padding padding = new Padding(1, 3, 3, 0);
public void ResetPadding()
{
padding = new Padding(1 3, 3, 0);
}
Regards,
Juan
> I can't see where your Padding and PaddingConverter is declared. Are you
> talking about DockPadding? For complex types, you should be using
[quoted text clipped - 12 lines]
> > Thanks,
> > Juan
Francois Miousse - 17 Dec 2004 15:49 GMT
I was having the same problem, and I found the solution.
Remove [DefaultValue(...)] and add ShouldSerializePadding.
Try this:
[Category("Layout")]
public new Padding Padding
{
get
{
return padding;
}
set
{
padding = value;
base.Padding = padding;
}
}
private Padding padding = new Padding(1, 3, 3, 0);
public void ResetPadding()
{
padding = new Padding(1 3, 3, 0);
}
public bool ShouldSerializeMargin()
{
return padding != new Padding( 1 3, 3, 0 );
}
Juan Ignacio Gelos - 17 Dec 2004 20:05 GMT
It worked!
Thanks again, Francois & Joey
> I was having the same problem, and I found the solution.
> Remove [DefaultValue(...)] and add ShouldSerializePadding.
[quoted text clipped - 25 lines]
> return padding != new Padding( 1 3, 3, 0 );
> }
joeycalisay - 20 Dec 2004 01:35 GMT
Actually, documentation says use one or the other. For the documentation,
try this one, it helped me a lot:
http://www.awprofessional.com/articles/printerfriendly.asp?p=169528
> It worked!
> Thanks again, Francois & Joey
[quoted text clipped - 28 lines]
> > return padding != new Padding( 1 3, 3, 0 );
> > }