473,789 Members | 2,514 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Persisting design-time property values?

I'm backporting a component to .NET 1.x, and it required me to use a custom
collection, StringList, instead of List<string>. StringList is derived from
CollectionBase and is marked serializable.

Here's my problem: I can't get design-time property values to persist. Here
is my property declaration:

[Browsable(true)]
[Category("Data" )]
[Description("Th e text to be shown for each link level while in its active
state")]
[Editor("System. Windows.Forms.D esign.StringCol lectionEditor, System.Design",
"System.Drawing .Design.UITypeE ditor, System.Drawing" )]
[DesignerSeriali zationVisibilit y (DesignerSerial izationVisibili ty.Visible)]
[EditorBrowsable (EditorBrowsabl eState.Always)]
public StringList ActiveTextList
{
get { return p_ActiveTextLis t; }
set { this.SetActiveT extListProperty (value); }
}

I thought I had the attributes required to serialize the property, but I
guess I'm missing something.

Can anyone shed some light on this? How come my property value isn't
persisting? Thanks.

--
David Veeneman
Foresight Systems
Aug 26 '06 #1
1 2091
Found my problem. The DesignerSeriali zationVisibilit y attribute was set
incorrectly. It should be:

[DesignerSeriali zationVisibilit y (DesignerSerial izationVisibili ty.Content)]

Note that it is not necessary to implement ISerializable on a custom class
to get it to serialize, unless you want the class to take control of the
serialization process.

--
David Veeneman
Foresight Systems
Aug 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1373
by: Mark Carter | last post by:
Are there any good ways of persisting/depersisting a Worksheet?
2
1662
by: Chris S. | last post by:
Out of a somewhat academic interest, I've created a rudimentary module for persisting dynamically created objects and data structures in plain Python source code. Presently, it's a little under a thousand lines of code. It's still a work in progress and has several limitations but it is producing results. Is there any interest for me to clean it up and publicly release it?
2
3089
by: Citoyen du Monde | last post by:
Trying to get some ideas on a simple javascript project (to teach myself the language). I want to develop a client-side vocabulary practice application that would allow users to enter their own words, their own definitions plus an example of how the word is used in practice. It'll be all client side with - cookies? to get persistence so that the words won't disappear on me each time the page is closed (which is what happened when I
4
1609
by: bob_yohan | last post by:
Hi all, I am rather new to database design and modelling concepts in general and was hoping for some advice on a problem I am trying to solve. I have designed a piece of software that creates a tree with pluggable nodes. Each node class can have 0 to n distinct classes plugged into it to define the type for that node. For example, a node plugged with a 'customer' class and an 'engineer' class would indicate that this node in the...
3
1368
by: Tom | last post by:
Hi, I am looking for an article or tutorial on persisting winform user input for the life of the app. How to design it? For instance, do I create a container class specific to each form? This data will need to be accessed throughout the application and then be persisted to a xml file. Any ideas? Thanks
4
3621
by: Dave Veeneman | last post by:
When does serializing objects make more sense than persisting them to a database? I'm new to object serialization, and I'm trying to get a feel for when to use it. Here is an example: I'm writing an accounting application. I have a chart of accounts in the form of a containment hierarchy. A GeneralLedger contains a number of Accounts, and each of these Accounts can contain a Aubledger, which contains its own Accounts, and so on. The...
0
884
by: Richard Myers | last post by:
Howdy, Im setting the imageUrl of a templated column of a datagrid in the ItemCreated event. The image changes depending on the status of a customer record being displayed in the grid. Somethings i cant validate for on the client and do so instead on the server. If an input is invalid i post pack to client. However because the user interacts with the grid i dont rebind when i postback and so consequently the item created event is not...
2
3277
by: xenophon | last post by:
I added a Hidden Form Field to a form in the code behind. The value is being set in JavaScript client-side, but it is not persisting to the server in the PostBack. I know the value is being set properly because it displays in the document.write method. Create a simple page and paste the below in the code-behind (ASP.NET 1.1-SP1) using System;
5
4839
by: Dick | last post by:
I have a GridView bound to an ObjectDataSource. I have a Button that calls GridView.DataBind. I want the row that is selected before the DataBind to still be selected afterwards. This happens automatically if the data doesn't change. But if records have been added or deleted then it looks as if some code is necessary: I've done this by using GridView.SelectedValue to get the key value of the currently selected Row and then by itterating...
4
1312
by: ewolfman | last post by:
Hi all, Recently I've learned of the ability to store Session data outside the worker process (WP), for instance the ability to use the ASP.NET State Service (aspnet_state.exe). This is great, because when the WP terminates or performs scavenging etc', the Session state remains untouched. I have data which is at *application* level, and I wish to be able to persist that data, just like I described regarding the Session
0
9663
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9506
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10193
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6761
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.