Example #1
0
        public static void Select(this IGraphPresentation presentation, Node node, SiblingsType role)
        {
            var selection = presentation.GetPropertySetFor <Selection>();

            foreach (var e in GetEdges(node, role).Where(presentation.Picking.Pick))
            {
                selection.Get(e.Id).IsSelected        = true;
                selection.Get(e.Source.Id).IsSelected = true;
                selection.Get(e.Target.Id).IsSelected = true;
            }
        }
Example #2
0
        private static IEnumerable <Edge> GetEdges(Node node, SiblingsType type)
        {
            if (type == SiblingsType.Sources || type == SiblingsType.Any)
            {
                foreach (var e in node.In)
                {
                    yield return(e);
                }
            }

            if (type == SiblingsType.Targets || type == SiblingsType.Any)
            {
                foreach (var e in node.Out)
                {
                    yield return(e);
                }
            }
        }