Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / January 2006

Tip: Looking for answers? Try searching our database.

Serialization Order for IExtenderProvider Properties

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tommy - 07 Dec 2005 16:12 GMT
I have created a component that implements several properties as an Extender
Provider. I store each controls location and dimensions for portrait and
landscape screen orientations (for a Tablet PC app). Everything works great
except that when the calls to add the extender provider properties are
serialized in the InitializeComponent method of the container form, it adds
my custom properties before setting the control's name which is a problme
since I use the name to keep up with each controls properties internally in
my component. Another odd psrt of this is that it sets one set of the
properties (the landscape ones) , then sets the name of the control, and then
sets the rest of the custom properties (for portrait). How can I control this
order? Or is there another design to work around this? Below is an example of
the InitializeComponent method:

this.layoutController1.SetLandscapeHeight(this.textBox1, 20);
this.layoutController1.SetLandscapeLeft(this.textBox1, 224);
this.layoutController1.SetLandscapeTop(this.textBox1, 80);
this.layoutController1.SetLandscapeWidth(this.textBox1, 280);
this.textBox1.Location = new System.Drawing.Point(224, 80);
this.textBox1.Name = "textBox1";
this.layoutController1.SetPortraitHeight(this.textBox1, 20);
this.layoutController1.SetPortraitLeft(this.textBox1, 224);
this.layoutController1.SetPortraitTop(this.textBox1, 80);
this.layoutController1.SetPortraitWidth(this.textBox1, 168);
this.textBox1.Size = new System.Drawing.Size(168, 20);
this.textBox1.TabIndex = 1;
this.textBox1.Text = "textBox1";

i need the Name property set first.

Thanks,

Tommy
Tommy - 07 Dec 2005 18:15 GMT
I figured out the reason why this works this way: alphabetical order (duh). I
did not think this was the problem since the method calls all start with Set
and were still in different places but it uses the ProvideProperty
declaration for the class. I renamed all these to start with "Z" and they
were last in the InitializeComponent section.

Tommy

> I have created a component that implements several properties as an Extender
> Provider. I store each controls location and dimensions for portrait and
[quoted text clipped - 28 lines]
>
> Tommy
Alvaro - 13 Jan 2006 22:03 GMT
Hi;

in this site found the solution sample, but it's in Spanish.

http://www.elguille.org/colabora/puntoNET/konamiman_ExtendiendoCodeDomSerializer.htm

I has this same problem and apply this solution.

> I figured out the reason why this works this way: alphabetical order (duh). I
> did not think this was the problem since the method calls all start with Set
[quoted text clipped - 36 lines]
>>
>>Tommy

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.