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 / August 2005

Tip: Looking for answers? Try searching our database.

Generating properties using a Custom ComponentDesigner

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frank@etc.be - 17 Aug 2005 21:13 GMT
Hi,

I have the following situation.

I've create a baseclass, derived it from Component and created a
custom designer for it. The desinger is more or less a grid in wich you
can add/edit some properties and attributes for them.

My goal is that when the designer is saved, all properties are
automaticly generated in the component is was designing.

I've noticed that you can implement your own CodeDomSerializer on a
component, but this only serializes the components public properties in
the 'InitializeComponent' method of its container.

I don't have a container, I would like to (re)generate to code of the
component I'm designing

I hope this makes sence, but is there someone who can tell me how I can
handle the complete (de)serialization of a component using its custom
designer.

Kind Regards
Frank Vanderlinden
Frank@etc.be - 18 Aug 2005 07:46 GMT
Maybe a little example to clarify.

Normally when you drop components on a designer, the following code is
generated

class TestItem : DesignableItem {
              private DesignableProperty designableProperty1;

    private void InitializeComponent() {
        this.designableProperty1 = new Dmx.Designers.DesignableProperty();
        // This comment was added to this object by a custom serializer.
        //
        // designableProperty1
        //
        this.designableProperty1.Name = "Test";

    }
}

I would like to change to (de)serialization of the componente so I get
the following result.

class TestItem : DesignableItem {
    private DesignableProperty designableProperty1;

    private void InitializeComponent() {
        this.designableProperty1 = new Dmx.Designers.DesignableProperty();
        this.designableProperty1.Name = "Test";
    }

    public string Test {
        get { return this.designableProperty1.Text; }
        set { this.designableProperty1.Text = value; }
    }
}

How can I automaticly generate the "Test" property ?

Kind regards
Frank Vanderlinden

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.