This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I am created two DiagramSurface named as ds and ds1. I need to perform some validation on the diagrams on different DiagramSurface during the node is being created. Is that anyway for me to do it? Is that possible for me to pass the value to the class below? public class ProcessNodeBuilder : IDiagramNodeBuilder diagram.Nodes.Add(new Process ContextDiagram1 check = new ContextDiagram1(diagram.Nodes.Count); if (answer == false)
Thank for your help. Janice |
|
|
Hello Janice. I'm not compleatly sure what you are asking here. What value are you wanting to give to the node builder? If you give me a little more information on what your planning to do here and how the 2 diagrams will affect node creation then I'll be able to help you with this as soon as possible. Thanks |
|
|
Hi, Jason, Thank for your response. Actually, i am declared two different DiagramSurface to allow me to draw two FlowDiagramModel instead of one. Now, i would like to perform checking when user drag a symbol on the DiagramSurface and each DiagramSurface has their own validation rule that needs to be followed. The system will work as below: 1. When user drag a Decision node on a DiagramSurface A. 2. The DesicionNodeBuilder is called, and create the Decision node. 3. Checking process is begin, when there is in DiagramSurface A, the Decision node cannot be more than two. An error message will be prompt if the rule is not satisfied. 4. Else, the Decision node can more than two. So, i am needed a way to get which DiagramSurface that the node drag into it. Very appreciate for your help. Thank. Janice
|
|
|
Hello Janice Thanks for this explination, it helps a lot. - Jason |
|
|
Hi Jason, Ya, i am able to check the number of node for the diagram model. However, the checking process is applied to both DiagramSurface instead of one that i wanted. This is because i cannot specific which DiagramSurface that the user drag and drop the symbol. Based on your explanation, does it means that i cannot perform the checking process within this CreateNode method? Thank you. Janice |
|
|
Hello Janice. There is no way to access the DiagramSurface from the CreateNode method alone. But you may be able to experiment with some things such as putting properties on your node builder classes to give it the DiagramSurface objects. When the CreateNode method is called, you can check which DiagramSurafce contains the Diagram object that was passed into the method. Then you will know which DiagramSurfacethe tool was dropped on. If you are still having trouble with this issue, you could try sending me a simplified sample of what you are trying to do so that I can help solve this more easily. Send to jason@mindscape.co.nz - Jason |
|
|
Hi, Jason, Sorry to trouble you again, i am facing the problem to send the email to you. Then, i will attach my simplify of my system here. Can you help me to check which part that goes wrong? Thank you. Janice.
|
|
|
Hello Janice Thanks for the sample it helps me quite a lot. I have played around with it and have found a possible solution to your problem. Here is what I did: First I put a public property on the ProcessNodeBuilder class called RestictedDiagram. This gets or sets an IDiagramModel object. Inside the CreateNode method, I put an 'if' statement around your checking logic which compares the given diagram model to the value of the RestrictedDiagram property. Then in the code-behind of the the CCDFDWin, I access the ProcessNodeBuilder object, and set its RestrictedDiagram property to be one of the FlowDiagramModels. You will want to set it to be the diagram that you want to apply the cheking to. It all works fine according to the requirements that you have mentioned in these forum posts. Give it a try and see if it was you were looking for and let me know if I have missed any details. If you are planning to include more of these validation rules for more diagrams and different types of nodes, then you may want to improve the structure of my solution a bit. But I hope this gives you a good starting point. I have attatched my modified version of your sample so you can see all the changes I have mentioned here. Note that I needed to remove all the project references to FlowDiagrams, Foundation, and Foundation.Design, so you'll need to add them back in to run the sample. Let me know what you think of my changes, or if your having trouble getting it to work in your environment. Regards |
|
|
Hello Jason, Thank a lot for your help. The solution that you provided is same as what i needed in my project. It helps me a lots. =) Regards, Janice. |
|