void OrgDiagram_GetLayoutInfo(object sender, LayoutInfoArgs args) { bool _mchildren = false; if ((args.Item.Info as INodeInfo).OutConnectors.Count() > 0) { foreach (var item in (args.Item.Info as INodeInfo).OutNeighbors) { if ((item.Info as INodeInfo).OutConnectors.Count() > 0) { _mchildren = false; break; } else { _mchildren = true; } } } if (_mchildren) { args.Type = ChartType.Right; } else { args.Type = ChartType.Alternate; } }
void MainWindow_GetLayoutInfo(object sender, LayoutInfoArgs args) { if (sfdiagram.LayoutManager.Layout is DirectedTreeLayout) { if ((sfdiagram.LayoutManager.Layout as DirectedTreeLayout).Type == LayoutType.Organization) { switch (compact) { case "left": if (!args.HasSubTree) { args.Type = ChartType.Left; args.Orientation = Orientation.Vertical; } break; case "right": if (!args.HasSubTree) { args.Type = ChartType.Right; args.Orientation = Orientation.Vertical; } break; case "alternate": if (!args.HasSubTree) { args.Type = ChartType.Alternate; args.Orientation = Orientation.Vertical; } break; case "horizontal_center": if (!args.HasSubTree) { args.Type = ChartType.Center; args.Orientation = Orientation.Horizontal; } break; case "horizontal_right": if (!args.HasSubTree) { args.Type = ChartType.Right; args.Orientation = Orientation.Horizontal; } break; case "horizontal_left": if (!args.HasSubTree) { args.Type = ChartType.Left; args.Orientation = Orientation.Horizontal; } break; } } } }