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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Programmaticaly accessing custom properties

Thread ID:

Created:

Updated:

Platform:

Replies:

36242 Oct 24,2005 06:55 PM UTC Oct 25,2005 01:25 PM UTC WinForms 3
loading
Tags: Diagram
Torben Stroyberg
Asked On October 24, 2005 06:55 PM UTC

Hi I am currently evaluating Essential Diagram and it is looking promising for my purposes. 1) I have a custom symbol class: Public Class QuestionSymbol Inherits Syncfusion.Windows.Forms.Diagram.Symbol Private line1 As Line Private line2 As Line Public Sub New() line1 = New Line(New PointF(10, 10), New PointF(10, 20)) Me.AppendChild(line1) line2 = New Line(New PointF(10, 10), New PointF(10, 20)) line2.LineStyle.LineColor = Color.Red line2.LineStyle.LineWidth = 5 Me.AppendChild(line2) End Sub End Class When using SetPropertyCmd I can alter width and color of line1 but not for line2. I have noticed the “Dynamic Symbol” example but this doesn’t use SetPropertyCmd and will therefore not work with Undo/Redo. How do I alter the properties of line2 using SetPropertyCmd? Thanks for any comments

Meera Fathima [Syncfusion]
Replied On October 25, 2005 07:42 AM UTC

Hello Stroyberg, You need to create an instance of your QuestionSymbol class and apply the SetPropertyCmd properties on this instance. This will let you reflect the changes in all the child nodes of the QuestionSymbol class. Here is sample code snippet for your reference. MyQuestionSymbol symbol = new MyQuestionSymbol(); SetPropertyCmd scmd = new SetPropertyCmd(); scmd.Nodes.Add(symbol); scmd.PropertyName = "LineWidth"; scmd.PropertyValue = 5.0F; this.diagram1.Controller.ExecuteCommand(scmd); scmd.Nodes.Clear(); scmd.Nodes.Add(symbol); scmd.PropertyName = "LineColor"; scmd.PropertyValue = Color.Red; this.diagram1.Controller.ExecuteCommand(scmd); Please let me know if you have any further questions on this issue. Thanks and Regards, Meera.

Torben Stroyberg
Replied On October 25, 2005 10:53 AM UTC

Thank you for your quick response to my question. In your example I think you will find that only line1 will be altered with regards to width and color. For line2 things stay unchanged. What I would like to be able to do is to control width and color of each bit that makes up a symbol individually using SetPropertyCmd (ie. width and height of both line1 and line2).

Meera Fathima [Syncfusion]
Replied On October 25, 2005 01:25 PM UTC

Hi Stroyberg, The way to do this would be using the Symbol.GetChildByName() method. This will let you to access and to control each child node of a symbol. Kindly take a look at the attached sample which will give you an idea about what you are seeking. Please let me know if you have any further queries on this issue. Thanks and Regards, Meera.

SetPropertyCmd_line.zip

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.

Warning Icon 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.Close Icon

;