Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Serialiazing CollectionBase

Reply
Thread Tools

Serialiazing CollectionBase

 
 
Victor Irzak
Guest
Posts: n/a
 
      04-29-2004
Hello...
I the following class deriving from CollectionBase:

============================
public class YYYepC : System.Collections.CollectionBase
{
int i = 9;

[DefaultValue(4)]
[PersistenceMode(PersistenceMode.Attribute)]
public int I
{
get {return i;}
set {i=value;
}
}
}
============================

When I try to serialize it in my web control, the "I" property doesn't get
serialized. Only the sollection items get serialized.

Here is my control:
============================
public class WebChartingControl : System.Web.UI.WebControls.WebControl
{

YYYepC da2 = new YYYepC();

[PersistenceMode(PersistenceMode.InnerProperty)]
[NotifyParentProperty(true)]
public YYYepC YYYepC
{
get {return da2;}
set {da2 = value;}
}
}
============================


How can I serialize all the other properties?

Thanks,

Victor


 
Reply With Quote
 
 
 
 
Fred Hirschfeld
Guest
Posts: n/a
 
      04-30-2004
I don't think I can answer your question but might be able to point you in
the right direction... Collections are intended to be serialized as items to
the Control when used this way. I use them to serialize inner tags to be
used by the control like the DataGrid uses Columns.

I think you are going to need to create a custom designer to process the
collection class so it does the properties of the collection instead of the
items of the collection. Take a look into DesignerSerializerAttribute class
to see if there are examples for it out there...

Fred

"Victor Irzak" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello...
> I the following class deriving from CollectionBase:
>
> ============================
> public class YYYepC : System.Collections.CollectionBase
> {
> int i = 9;
>
> [DefaultValue(4)]
> [PersistenceMode(PersistenceMode.Attribute)]
> public int I
> {
> get {return i;}
> set {i=value;
> }
> }
> }
> ============================
>
> When I try to serialize it in my web control, the "I" property doesn't get
> serialized. Only the sollection items get serialized.
>
> Here is my control:
> ============================
> public class WebChartingControl : System.Web.UI.WebControls.WebControl
> {
>
> YYYepC da2 = new YYYepC();
>
> [PersistenceMode(PersistenceMode.InnerProperty)]
> [NotifyParentProperty(true)]
> public YYYepC YYYepC
> {
> get {return da2;}
> set {da2 = value;}
> }
> }
> ============================
>
>
> How can I serialize all the other properties?
>
> Thanks,
>
> Victor
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Returning CollectionBase from WebService Web Team @ Borough of Poole ASP .Net 1 04-27-2005 10:14 AM
Performance of CollectionBase class Vadivel Kumar ASP .Net 4 02-17-2005 03:45 AM
Is there a dataadapter that can use a class collectionbase as it's source? Steve Mauldin ASP .Net 0 08-27-2004 04:45 PM
collection list count (CollectionBase) list.add - problems jason@cyberpine.com ASP .Net 3 11-03-2003 05:55 PM
Binding custom objects to datagrid WITHOUT using Collectionbase Rachel Koktava ASP .Net Datagrid Control 2 09-15-2003 08:16 PM



Advertisments