Exemplo n.º 1
0
        public static List <INode> GetDependencies(this TreeContext context, IDepend depend)
        {
            List <INode> dependencies = depend.Dependencies.DistinctDependencies()
                                        .Select(context.GetDependencyNode)
                                        .ToList();

            context.GetParentGroup(depend)?.AddGroupDependency(context, dependencies);
            return(dependencies);
        }
Exemplo n.º 2
0
        public static List <INode> GetDependencies(this TreeContext context, INode node)
        {
            List <INode> dependencies = node.Provider.Dependencies
                                        .Select(x => context.Tree.GetNode(x.Token))
                                        .ToList();

            context.GetParentGroup(node.Provider)?.AddGroupDependency(context, dependencies);
            return(dependencies.Distinct().ToList());
        }
        public static void ReorderNodes(this TreeContext context,
                                        IDepend depend,
                                        IDependency dependency1,
                                        IDependency dependency2)
        {
            var node1 = context.GetDependencyNode(dependency1);
            var node2 = context.GetDependencyNode(dependency2);

            if (node1 == node2)
            {
                return;
            }

            ReorderNodes(node1, node2, depend.DiagInfo);
            context.CreateNonEqualFilter(node1, node2, context.GetParentGroup(depend), depend.DiagInfo);
        }
Exemplo n.º 4
0
        public static void AssignFilter(this TreeContext context, IFilter filter)
        {
            var finalFilter = context.GetFinalFilter(filter);
            var node        = context.GetGroupNode(filter as IFilterGroup);

            if (node != null)
            {
                context.AssignFilterToNode(finalFilter, node);
                return;
            }

            var group = context.GetParentGroup(filter);

            if (group == null || context.IsFilterAbsorbed(filter, group))
            {
                context.AssignFilterToNode(finalFilter, context.GetAssignmentNode(filter));
            }
            else
            {
                group.Filters.Add(finalFilter);
            }
        }