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 / WinForm General / March 2006

Tip: Looking for answers? Try searching our database.

problem with IExtenderProvider

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martin - 14 Mar 2006 09:20 GMT
I'm implemented a class called MyProvider which inherited from Component and
IExtenderProvider. i have the problem, that when I typed anything in the
visual studio designer in my MyItem-object which is provided by MyProvider,
the data is lost, after I clicked in another textbox. i added the following
methods in my provider:

[ProviderProperty("MyProvider", typeof(Control)]
public class MyProvider : Component, IExtenderProvider {

[ExtenderProvidedProperty]
[TypeConverter(typeof(MyItemConverter))]
public MyItem GetMyProvider(Control control) { }

[ExtenderProvidedProperty]
public void SetMyProvider(Control extendee, MyItem value) { }

public bool ShouldSerializeMyProvider(Control extendee) {}

}

my MyItem class has 4 properties. 2 of them are hidden for the designer
serialization.the last 2 properties are of type string.

any ideas why he deletes the entered data?
Nick Hounsome - 14 Mar 2006 09:40 GMT
> I'm implemented a class called MyProvider which inherited from Component
> and IExtenderProvider. i have the problem, that when I typed anything in
[quoted text clipped - 20 lines]
>
> any ideas why he deletes the entered data?

Because you are not saving it anywhere.
Let's see the actual method code.
Martin - 14 Mar 2006 10:27 GMT
Ok i found the bug... it was an oversight

in my Get method I created a new instance of my object and returned it. the
problem was that i didn't add the new instance to my internal collection.

but i have an onther problem too. when I'm trying to save the project with
my provider. I got an error "An error occurred while code generation for the
MyProvider-Property. the object rereference hasn't got a object instance."

maybe its a problem with my converter?

>> I'm implemented a class called MyProvider which inherited from Component
>> and IExtenderProvider. i have the problem, that when I typed anything in
[quoted text clipped - 23 lines]
> Because you are not saving it anywhere.
> Let's see the actual method code.

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.