473,413 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

CodeDomSerializer

Hi,

I have written a custom web control with a DesignSerializer.
If i change a property in design-time, the serializer starts before the
properties will be set in the control (the object "value" in the serialize
method has the old property value). Thats annoying cause the serialize
should write somthing to the code that depends on the property.

Does anyone know a solution for my problem?

regards,
Björn Marthen
Nov 15 '05 #1
1 3089
Björn Marthen schrieb:
Hi,

I have written a custom web control with a DesignSerializer.
If i change a property in design-time, the serializer starts before the
properties will be set in the control (the object "value" in the serialize
method has the old property value). Thats annoying cause the serialize
should write somthing to the code that depends on the property.

Does anyone know a solution for my problem?

regards,
Björn Marthen

Hi Björn,

in the Method Serialize in your Serializer, the last parameter is your
control. you can access its properties and serialize values.

Public Overrides Function Serialize(ByVal manager As
System.ComponentModel.Design.Serialization.IDesign erSerializationManager,
ByVal value As Object) As Object

'ms-help://MS.VSCC.2003/MS.MSDNQTR.2003APR.1033/cpref/html/frlrfSystemComponentModelDesignSerializationCodeDo mSerializerClassTopic.htm
Dim BaseSerializer As CodeDomSerializer =
manager.GetSerializer(GetType(MyControl).BaseType,
GetType(CodeDomSerializer))
Dim codeObject As Object =
BaseSerializer.Serialize(manager, value)
Dim oMyControl As MyControl= CType(value, MyControl)
....
now you can serialize the code and use your control.

Nov 15 '05 #2

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

Similar topics

0
by: Vimal | last post by:
Hello all, I am new to learning about the CodeDomSerializer Class. Can someone please help me with links to documentation or samples regarding using the SerializeResource method of the...
0
by: Frank VDL | last post by:
Hi, I've created my own component that uses the CodeDomSerializer to generate some extra code in the "InitizializeComponent" Every thing seems to work fine, until I compile my app... Every...
1
by: onyxring | last post by:
I've been building custom web controls in C# with VS2005. Currently I'm looking into adding design-time functionality and have reached a point where I need to generate code in the page the custom...
0
by: onyxring | last post by:
I'm reposting this, because I had a bit of difficulty last time and think that it might have fallen through the cracks. If I'm posting to the wrong groups, please let me know. Surely someone has...
0
by: onyxring | last post by:
I've been building custom web controls in C# with VS2005. Currently I'm looking into adding design-time functionality and have reached a point where I need to generate code in the page the custom...
0
by: onyxring | last post by:
I've been building custom web controls in C# with VS2005. Currently I'm looking into adding design-time functionality and have reached a point where I need to generate code in the page the custom...
0
by: Adam Right | last post by:
Hi, I am using contextmenustrip in my usercontrol in which there is a grid control associated with it. I added the rows below in the designer code, to create contextmenustrip with its...
1
by: EvilProject | last post by:
Hi, I'm writing a custom codedomserializer for a control(using DesignerSerializer). It works great but i can only insert statements to the initializecompenet method. I want to create a methods in...
2
by: pavanip | last post by:
Hi, I developed a windows application in Vb.Net 2003.It is working fine in this. But when I am trying to convert this into .Net 2005 I am getting this error. Class not registered...
2
by: Mufasa | last post by:
I have a .Net 1.1 program that works fine that plays flash files. I am converting it to .Net 2.0 and am getting all kinds of compilation errors about not finding files or assemblies. Here's the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.