473,549 Members | 2,568 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CodeDomSerializ er

Hi,

I have written a custom web control with a DesignSerialize r.
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 3101
Björn Marthen schrieb:
Hi,

I have written a custom web control with a DesignSerialize r.
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.Componen tModel.Design.S erialization.ID esignerSerializ ationManager,
ByVal value As Object) As Object

'ms-help://MS.VSCC.2003/MS.MSDNQTR.2003 APR.1033/cpref/html/frlrfSystemComp onentModelDesig nSerializationC odeDomSerialize rClassTopic.htm
Dim BaseSerializer As CodeDomSerializ er =
manager.GetSeri alizer(GetType( MyControl).Base Type,
GetType(CodeDom Serializer))
Dim codeObject As Object =
BaseSerializer. Serialize(manag er, 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
1364
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 CodeDomSerializer Class(to serialize a Image Resource). Any clues would be of great help. Thanks a lot - in advance,
0
1004
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 time I compile my application, all generated code is lost ? What is going wrong ?
1
2145
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 control is on. Enter the CodeDomSerializer class. I've found several examples creating Designer Serializers, nearly all of them for windows...
0
1390
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 some experience with this... I've been building custom web controls in C# with VS2005. Currently I'm looking into adding design-time functionality...
0
1047
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 control is on. Enter the CodeDomSerializer class. I've found several examples creating Designer Serializers, nearly all of them for windows...
0
1157
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 control is on. Enter the CodeDomSerializer class. I've found several examples creating Designer Serializers, nearly all of them for windows...
0
1373
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 constructor which takes the "IContainer" parameter. "this.m_Components" is defined in my base usercontrol as a protected member. My code is below in my...
1
2184
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 the container of the control outside the initalizecomponent method. how can this be done?
2
48906
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 (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)) at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object...
2
1965
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 error message in the design view of the window. Could not load file or assembly 'Interop.WMPLib, Version=1.0.0.0,
0
7527
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...
0
7459
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...
0
7726
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7967
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...
1
7485
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...
0
7819
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5097
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...
0
3505
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...
1
1064
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.