当前位置: 首页>>代码示例>>C#>>正文


C# ProjectManager.DependantsOf方法代码示例

本文整理汇总了C#中ProjectManager.DependantsOf方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectManager.DependantsOf方法的具体用法?C# ProjectManager.DependantsOf怎么用?C# ProjectManager.DependantsOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProjectManager的用法示例。


在下文中一共展示了ProjectManager.DependantsOf方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateRelationThatAlreadyExist

        public void CreateRelationThatAlreadyExist()
        {
            IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
            var one = new Task();
            var two = new Task();
            manager.Add(one);
            manager.Add(two);

            // setup: create a relationship
            manager.Relate(one, two);
            Assert.IsTrue(manager.DependantsOf(one).Contains(two));
            Assert.IsTrue(manager.PrecedentsOf(two).Contains(one));

            // test: re-create the relationship (no effect)
            manager.Relate(one, two);
            Assert.IsTrue(manager.DependantsOf(one).Contains(two));
            Assert.IsTrue(manager.PrecedentsOf(two).Contains(one));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:18,代码来源:ProjectTest.cs

示例2: EnumerationShouldReturnEmptySet

        public void EnumerationShouldReturnEmptySet()
        {
            IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
            var alien = new Task();

            // test: Enumerators should at least return empty sets
            Assert.IsNotNull(manager.ChildrenOf(alien), "ChildrenOf is null");
            Assert.IsNotNull(manager.AncestorsOf(alien), "AncestorsOf is null");
            Assert.IsNotNull(manager.DecendantsOf(alien), "DecendantsOf is null");
            Assert.IsNotNull(manager.DependantsOf(alien), "DependantsOf is null");
            Assert.IsNotNull(manager.PrecedentsOf(alien), "PrecedentsOf is null");
            Assert.IsNotNull(manager.DirectDependantsOf(alien), "DirectDependantsOf is null");
            Assert.IsNotNull(manager.DirectPrecedentsOf(alien), "DirectPrecedentsOf is null");
            Assert.IsNotNull(manager.ResourcesOf(alien), "ResourcesOf is null");
            Assert.IsNotNull(manager.TasksOf(alien), "TasksOf is null");
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:16,代码来源:ProjectTest.cs

示例3: Create3LevelRelations

        public void Create3LevelRelations()
        {
            IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
            var one = new Task();
            var two = new Task();
            var three = new Task();
            manager.Add(one);
            manager.Add(two);
            manager.Add(three);

            // setup: one before two before three
            manager.Relate(one, two);
            manager.Relate(two, three);

            // test: check enumerations are established
            Assert.IsTrue(manager.DependantsOf(one).Count() == 2);
            Assert.IsTrue(manager.DependantsOf(two).Count() == 1);
            Assert.IsTrue(manager.DependantsOf(three).Count() == 0);

            Assert.IsTrue(manager.DirectDependantsOf(one).Count() == 1);
            Assert.IsTrue(manager.DirectDependantsOf(two).Count() == 1);
            Assert.IsTrue(manager.DirectDependantsOf(three).Count() == 0);

            Assert.IsTrue(manager.PrecedentsOf(one).Count() == 0);
            Assert.IsTrue(manager.PrecedentsOf(two).Count() == 1, string.Format("expected {0} != {1}", 1, manager.PrecedentsOf(two).Count()));
            Assert.IsTrue(manager.PrecedentsOf(three).Count() == 2);

            Assert.IsTrue(manager.DirectPrecedentsOf(one).Count() == 0);
            Assert.IsTrue(manager.DirectPrecedentsOf(two).Count() == 1);
            Assert.IsTrue(manager.DirectPrecedentsOf(three).Count() == 1);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:31,代码来源:ProjectTest.cs

示例4: CreateRelation

        public void CreateRelation()
        {
            IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
            var one = new Task();
            var two = new Task();
            manager.Add(one);
            manager.Add(two);

            // setup: confirms no relations
            Assert.IsTrue(manager.DependantsOf(one).Count() == 0);
            Assert.IsTrue(manager.PrecedentsOf(two).Count() == 0);

            // test: create a relationship
            manager.Relate(one, two);
            Assert.IsTrue(manager.DependantsOf(one).Contains(two));
            Assert.IsTrue(manager.PrecedentsOf(two).Contains(one));
            Assert.IsTrue(manager.HasRelations(one));
            Assert.IsTrue(manager.HasRelations(two));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:19,代码来源:ProjectTest.cs

示例5: CircularRelationLevel1

        public void CircularRelationLevel1()
        {
            IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
            var one = new Task();
            var two = new Task();
            manager.Add(one);
            manager.Add(two);

            // setup: create a relationship
            manager.Relate(one, two);
            Assert.IsTrue(manager.DependantsOf(one).Contains(two));
            Assert.IsTrue(manager.DependantsOf(one).Count() == 1);
            Assert.IsTrue(manager.PrecedentsOf(one).Count() == 0);

            Assert.IsTrue(manager.PrecedentsOf(two).Contains(one));
            Assert.IsTrue(manager.PrecedentsOf(two).Count() == 1);
            Assert.IsTrue(manager.DependantsOf(two).Count() == 0);

            // test: cycle the relationship (no effect)
            manager.Relate(two, one);
            Assert.IsTrue(manager.DependantsOf(one).Contains(two));
            Assert.IsTrue(manager.DependantsOf(one).Count() == 1);
            Assert.IsTrue(manager.PrecedentsOf(one).Count() == 0);

            Assert.IsTrue(manager.PrecedentsOf(two).Contains(one));
            Assert.IsTrue(manager.PrecedentsOf(two).Count() == 1);
            Assert.IsTrue(manager.DependantsOf(two).Count() == 0);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:28,代码来源:ProjectTest.cs

示例6: RemoveExistingRelation

        public void RemoveExistingRelation()
        {
            IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
            var one = new Task();
            var two = new Task();
            manager.Add(one);
            manager.Add(two);

            // setup: create a relationship
            manager.Relate(one, two);
            Assert.IsTrue(manager.DependantsOf(one).Contains(two));
            Assert.IsTrue(manager.PrecedentsOf(two).Contains(one));

            // test: remove relation
            manager.Unrelate(one, two);
            Assert.IsTrue(manager.DependantsOf(one).Count() == 0);
            Assert.IsTrue(manager.PrecedentsOf(two).Count() == 0);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:18,代码来源:ProjectTest.cs

示例7: RemoveAllDependantsRelation

        public void RemoveAllDependantsRelation()
        {
            IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
            var one = new Task();
            var two = new Task();
            var three = new Task();
            var four = new Task();
            manager.Add(one);
            manager.Add(two);
            manager.Add(three);
            manager.Add(four);

            // setup: create a relationship
            manager.Relate(four, one);
            manager.Relate(one, two);
            manager.Relate(one, three);
            Assert.IsTrue(manager.DependantsOf(one).Contains(three));
            Assert.IsTrue(manager.PrecedentsOf(two).Contains(one));
            Assert.IsTrue(manager.PrecedentsOf(three).Contains(one));
            Assert.IsTrue(manager.DependantsOf(four).Contains(one));
            Assert.IsTrue(manager.PrecedentsOf(one).Contains(four));

            // test: remove dependants
            manager.Unrelate(one);
            Assert.IsTrue(manager.DependantsOf(one).Count() == 0);
            Assert.IsTrue(manager.PrecedentsOf(two).Count() == 0);
            Assert.IsTrue(manager.PrecedentsOf(three).Count() == 0);
            Assert.IsTrue(manager.DependantsOf(four).Contains(one));
            Assert.IsTrue(manager.PrecedentsOf(one).Contains(four));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:30,代码来源:ProjectTest.cs

示例8: RelatedTaskCannotBecomeParts

        public void RelatedTaskCannotBecomeParts()
        {
            IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
            var split = new Task();
            var part1 = new Task();
            var part2 = new Task();
            manager.Add(split);
            manager.Add(part1);
            manager.Add(part2);

            // setup: relate part1 and part2
            manager.Relate(part1, part2);
            Assert.IsTrue(manager.HasRelations(part1));
            Assert.IsTrue(manager.HasRelations(part2));
            Assert.IsTrue(manager.DependantsOf(part1).Contains(part2));

            // test: split task using part1 and part2
            manager.Split(split, part1, part2, 1);
            Assert.IsTrue(manager.HasRelations(part1));
            Assert.IsTrue(manager.HasRelations(part2));
            Assert.IsTrue(manager.DependantsOf(part1).Contains(part2));
            Assert.IsTrue(!manager.IsSplit(split));
            Assert.IsTrue(!manager.IsPart(part1));
            Assert.IsTrue(!manager.IsPart(part2));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:25,代码来源:ProjectTest.cs

示例9: KnownTasksEnumeration

        public void KnownTasksEnumeration()
        {
            IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
            var local = new Task();
            manager.Add(local);

            Assert.IsNotNull(manager.ChildrenOf(local));
            Assert.IsNotNull(manager.AncestorsOf(local));
            Assert.IsNotNull(manager.DecendantsOf(local));
            Assert.IsNotNull(manager.DependantsOf(local));
            Assert.IsNotNull(manager.PrecedentsOf(local));
            Assert.IsNotNull(manager.DirectDependantsOf(local));
            Assert.IsNotNull(manager.DirectPrecedentsOf(local));
            Assert.IsNotNull(manager.ResourcesOf(local));
            Assert.IsNotNull(manager.TasksOf(local));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:16,代码来源:ProjectTest.cs


注:本文中的ProjectManager.DependantsOf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。