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.

Connector''s decorator

Thread ID:

Created:

Updated:

Platform:

Replies:

81889 May 22,2009 03:15 AM May 26,2009 05:08 AM Windows Forms 4
loading
Tags: Diagram
Veaceslav Cosulet
Asked On May 22, 2009 03:15 AM

Hi everybody.
Does anyone know how to change default(a simple line between two ports) connector decorator's after activating LineTool?
How can I get a list of End Point Decorators?
Thanks.
Best regards, Frank.

Gowri Manohari D [Syncfusion]
Replied On May 23, 2009 01:57 AM


Hi Frank,

Thanks for choosing Syncfusion Products.

The below is the code snippet for your first requirement.Code illustrates changing Decorators for LineConnectors.

diagram1.ActivateTool("LineTool");
LineTool line = (LineTool)diagram1.Controller.ActiveTool;
line.HeadDecorator.DecoratorShape = DecoratorShape.Filled45Arrow;

Please provide the some more details about your second question.



Thanks & Regards,
Gowri

Veaceslav Cosulet
Replied On May 25, 2009 04:35 AM

Thanks Gowri.
As for the second question, under below link below one can see all types of decorators in a window
http://syncfusion.com/products/windows-forms/diagram/end-point-decorator

Is it possible to get them all, I mean types of decorators, in such a window or I have to customize it myself in order to get them in such a window, or a ComboBox ???
Thanks.
Best regards, Frank.

Veaceslav Cosulet
Replied On May 25, 2009 06:40 AM

Hi again Gowri.
I wrote the bellow code in order to change line end decorator,

diagram1.ActivateTool("LineConnectorTool");
LineConnectorTool lineConnector = (LineConnectorTool)diagram1.Controller.ActiveTool;
lineConnector.HeadDecorator.DecoratorShape = DecoratorShape.Filled45Arrow;

but gained the following error:

System.InvalidCastException was unhandled
Message="Unable to cast object of type 'Syncfusion.Windows.Forms.Diagram.SelectTool' to type 'Syncfusion.Windows.Forms.Diagram.LineConnectorTool'."
Source="TrySyncfusionComponents"
StackTrace:
at TrySyncfusionComponents.Form1.button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\cosulet\My Documents\Visual Studio 2008\Projects\TrySyncfusionComponents\TrySyncfusionComponents\Form1.cs:line 28
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at TrySyncfusionComponents.Program.Main() in C:\Documents and Settings\cosulet\My Documents\Visual Studio 2008\Projects\TrySyncfusionComponents\TrySyncfusionComponents\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:


In order to solve it I wrote

diagram1.ActivateTool("LineLinkTool");
LineConnectorTool lineConnector = (LineConnectorTool)diagram1.Controller.ActiveTool;
lineConnector.HeadDecorator.DecoratorShape = DecoratorShape.Filled45Arrow;

But in a warning it was said that LIneLinkTool is obsolete. One should use LineConnectorTool instead.

Does diagram1.ActivateTool("LineLinkTool"); activate LineLinkTool, or LineConnectorToll instead???
Thnaks and regards, Frank.

Gowri Manohari D [Syncfusion]
Replied On May 26, 2009 05:08 AM

Hi Frank,

Thanks for choosing Syncfusion Products.

I could reproduce your error.While activating LineConnectorTool,system throws an error.Because no tool is available with the name LineConnectorTool,thats why it shows default SelectTool.

LineConnectorTool is referred with the name as LineLinkTool.Instead of using LineConnectorTool,you can use LineLinkTool.Refer the sample code below.


diagram1.Controller.ActivateTool("LineLinkTool");
LineConnectorTool con = (LineConnectorTool)diagram1.Controller.ActiveTool;
con.HeadDecorator.DecoratorShape = DecoratorShape.Filled45Arrow;


Thanks & Regards,
Gowri

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.

;