Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Automatic remove child node. (Read 5573 times)
suwit
Guest


Automatic remove child node.
Oct 31st, 2005 at 1:11pm
Print Post  
How to automatic copy/Remove child node. when parent has copied/remove. ???
  
Back to top
 
IP Logged
 
Iva
Junior Member
**
Offline


MindFusion support

Posts: 55
Joined: Aug 6th, 2005
Re: Automatic remove child node.
Reply #1 - Oct 31st, 2005 at 1:39pm
Print Post  
What do you mean by 'child node' ? Is that a child node in a tree or an attached/subordinated node in a group ?
  
Back to top
 
IP Logged
 
suwit
Guest


Re: Automatic remove child node.
Reply #2 - Oct 31st, 2005 at 3:08pm
Print Post  
Pls check it in a Flowchart.NET Demo project 
-> Item of "Miscellaneous Feature" sample.
i want to remove "Belin" and it should be automatically remove the node "1km".
Like cardcade delete.
Regards,
Swt
  
Back to top
 
IP Logged
 
suwit
Guest


Re: Automatic remove child node.
Reply #3 - Oct 31st, 2005 at 3:13pm
Print Post  
Same problem in sample "Network sample"
when i removed node "Desktop Computer" icon why node's description not remove together.
  
Back to top
 
IP Logged
 
Iva
Junior Member
**
Offline


MindFusion support

Posts: 55
Joined: Aug 6th, 2005
Re: Automatic remove child node.
Reply #4 - Oct 31st, 2005 at 4:03pm
Print Post  
Set the Group object's AutoDeleteItems to true. That makes the subordinated items in a group deleted when the group master is deleted.
  
Back to top
 
IP Logged
 
suwit
Guest


Re: Automatic remove child node.
Reply #5 - Nov 1st, 2005 at 3:51pm
Print Post  
thanks, it's work!
and one question, how about copy Group object ? is it posible to do like delete ?
Thanks,
Swt.
  
Back to top
 
IP Logged
 
Iva
Junior Member
**
Offline


MindFusion support

Posts: 55
Joined: Aug 6th, 2005
Re: Automatic remove child node.
Reply #6 - Nov 1st, 2005 at 4:16pm
Print Post  
Is that about copying to the clipboard? Unfortunately there isn't any similar property to let you copy groups to the clipboard.

Still it might be easy to implement that like this: Before calling PasteFromClipboard, remember in a variable the size of the fc.Objects collection. After calling the Paste method, do a cycle on fc.Objects starting from the saved size and running to the end of the collection. The iterated objects would be all the pasted ones. For each object that should have a group, just recreate its group.

That would work fine if the child objects are just some UI elements or decorations, as in the 1st screen that shows tables and groups in the FCDemo sample.

Regards
  
Back to top
 
IP Logged
 
suwit
Guest


Re: Automatic remove child node.
Reply #7 - Nov 2nd, 2005 at 1:14am
Print Post  
Hello,
could u pls show me a sample code to implement this.
??? ??? ??? ???
Thanks,
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Automatic remove child node.
Reply #8 - Nov 2nd, 2005 at 8:48am
Print Post  
Hi,

Say you have a method createDecorations(Table) that creates and groups some UI boxes to a table. Then you could implement pasting like that:

[code]
private void paste_Click(object sender, System.EventArgs e)
{
  int oldItemCount = fc.Objects.Count;
  fc.PasteFromClipboard(0, 0);
  for (int i = oldItemCount; i < fc.Objects.Count; ++i)
  {
    Table table = fc.Objects[i] as Table;
    if (table != null)
     createDecorations(table);
  }
}
[/code]

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint