Пример #1
0
        /// <summary>
        /// Initializes the option handler for the export
        /// </summary>
        private void SetupHandler()
        {
            handler = new OptionHandler(LayoutOptions);
            OptionItem componentItem = handler.AddList(ComponentAssignment,
                                                       new[]
            {
                ComponentAssignmentStrategy.Single,
                ComponentAssignmentStrategy.Connected
            },
                                                       ComponentAssignmentStrategy.Single);
            OptionItem subgraphItem = handler.AddList(SubgraphLayout, SubGraphLayouts.Keys, LayoutIncremental);

            handler.Add(SubgraphPositioning, SubgraphPlacement.Barycenter);
            handler.Add(EdgeRouting, EdgeRoutingStrategy.Automatic);
            handler.Add(LayoutOrientationStrategy, LayoutOrientation.TopToBottom);
            handler.AddInt(MinimumNodeDistance, 5, 0, int.MaxValue);
            handler.AddBool(AllowMirroring, true);
            handler.AddBool(NodeSnapping, true);
            var cm = new ConstraintManager(Handler);

            cm.SetEnabledOnValueEquals(componentItem, ComponentAssignmentStrategy.Connected, subgraphItem);
        }