We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Symbol Model programatically

Thread ID:

Created:

Updated:

Platform:

Replies:

34784 Sep 15,2005 04:19 PM Sep 15,2005 05:00 PM Windows Forms 1
loading
Tags: Diagram
Darren Mombourquette
Asked On September 15, 2005 04:19 PM

This may be a stupid question. I have created a Symbol Model for an object using the symbol designer, set the plugin properties, saved the symbol pallete and loaded into the designer. Everything works fine when dragging a new symbol model to the diagram. What I can''t figure out is how to programatically get a reference to the symbol model already loaded in the pallete and create a symbol based off this model. I can easily create a new instance of the symbol itself and add it to the diagram but it doesn''t have the symbol model attached to it. Thanks, Darren

Administrator [Syncfusion]
Replied On September 15, 2005 05:00 PM

Hi Darren, You can use the SymbolPalette.GetChildByName(string) method to obtain the SymbolModel that you are interested in. Once you have the SymbolModel, you can call SymbolModel.CreateSymbol() to instantiate the symbol instance. If you are using the PaletteGroupView control, the PaletteGroupView.Palette property will let you retrieve the SymbolPalette loaded into the control. The following code should give you an idea, // Obtain the ''Start'' SymbolModel and instantiate the symbol SymbolModel symmodel = this.GetSymbolModel(palette,"Start"); Symbol sym = symmodel.CreateSymbol(); // Get the SymbolModel from the SymbolPalette public SymbolModel GetSymbolModel(SymbolPalette palette, string symbolName) { INode symmodel = palette.GetChildByName(symbolName); if(symmodel != null) return (SymbolModel)symmodel; return null; } Thanks, Prakash Surendra Syncfusion Inc.,

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;