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


C# ProjectManager.Join方法代码示例

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


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

示例1: AdjustGroupDuringJoin

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

            // setup: create a split under a group
            manager.Group(group, split);
            manager.Split(split, part1, part2, 1);
            manager.Split(part2, part3, 1);
            Assert.IsTrue(group.Duration == 5);
            Assert.IsTrue(group.Duration == split.Duration);
            Assert.IsTrue(group.End == part3.End);

            // test: join and make sure group duration is shortened
            manager.Join(part1, part3);
            Assert.IsTrue(!manager.IsPart(part3));
            Assert.IsTrue(group.Duration == 4);
            Assert.IsTrue(group.Duration == split.Duration);
            Assert.IsTrue(group.End == part2.End);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:26,代码来源:ProjectTest.cs

示例2: JoinParts

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

            // setup: create a split task with 3 parts
            manager.Split(split, part1, part2, 1);
            manager.Split(part2, part3, 1);
            Assert.IsTrue(manager.IsSplit(split));
            Assert.IsTrue(manager.IsPart(part1));
            Assert.IsTrue(manager.IsPart(part2));
            Assert.IsTrue(manager.IsPart(part3));
            Assert.IsTrue(manager.PartsOf(split).Count() == 3);
            Assert.IsTrue(manager.PartsOf(split).ElementAt(0) == part1);
            Assert.IsTrue(manager.PartsOf(split).ElementAt(1) == part2);
            Assert.IsTrue(manager.PartsOf(split).ElementAt(2) == part3);

            // test: join part 1 and part2
            manager.Join(part1, part2);
            Assert.IsTrue(manager.IsSplit(split));
            Assert.IsTrue(manager.IsPart(part1));
            Assert.IsTrue(!manager.IsPart(part2));
            Assert.IsTrue(manager.IsPart(part3));
            Assert.IsTrue(manager.PartsOf(split).Count() == 2);
            Assert.IsTrue(manager.PartsOf(split).ElementAt(0) == part1);
            Assert.IsTrue(manager.PartsOf(split).ElementAt(1) == part3);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:31,代码来源:ProjectTest.cs

示例3: JoinPartsConfirmPackedSchedule

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

            // setup: create a 4 part split task
            manager.SetDuration(split, 40);
            manager.Split(split, part1, part2, 5);
            manager.Split(part2, part3, 10);
            manager.Split(part3, part4, 20);
            Assert.IsTrue(part4.Duration == 5);
            Assert.IsTrue(part2.Duration == 10);
            Assert.IsTrue(manager.IsPart(part1));
            Assert.IsTrue(manager.IsPart(part2));
            Assert.IsTrue(manager.IsPart(part3));
            Assert.IsTrue(manager.IsPart(part4));
            Assert.IsTrue(manager.IsSplit(split));
            Assert.IsTrue(manager.PartsOf(split).Count() == 4);

            Assert.IsTrue(part1.Start == 0);
            Assert.IsTrue(part1.End == 5);
            Assert.IsTrue(part2.Start == 6);
            Assert.IsTrue(part2.End == 16);
            Assert.IsTrue(part3.Start == 17);
            Assert.IsTrue(part3.End == 37);
            Assert.IsTrue(part4.Start == 38);
            Assert.IsTrue(part4.End == 43);

            // test: join part 2 and 4
            manager.Join(part2, part4);
            Assert.IsTrue(part2.Duration == 15);
            Assert.IsTrue(manager.IsPart(part1));
            Assert.IsTrue(manager.IsPart(part2));
            Assert.IsTrue(manager.IsPart(part3));
            Assert.IsTrue(!manager.IsPart(part4));
            Assert.IsTrue(manager.IsSplit(split));
            Assert.IsTrue(manager.PartsOf(split).Count() == 3);

            Assert.IsTrue(part1.Start == 0);
            Assert.IsTrue(part1.End == 5);
            Assert.IsTrue(part2.Start == 6);
            Assert.IsTrue(part2.End == 21);
            Assert.IsTrue(part3.Start == 22);
            Assert.IsTrue(part3.End == 42);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:50,代码来源:ProjectTest.cs

示例4: JoinPartRemainSinglePartBecomeRegularTask

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

            // setup: create split task with only part1 and part2
            manager.Split(split, part1, part2, 1);
            Assert.IsTrue(manager.IsSplit(split));
            Assert.IsTrue(manager.IsPart(part1));
            Assert.IsTrue(manager.IsPart(part2));
            Assert.IsTrue(manager.PartsOf(split).Count() == 2);
            Assert.IsTrue(manager.PartsOf(split).ElementAt(0) == part1);
            Assert.IsTrue(manager.PartsOf(split).ElementAt(1) == part2);

            // test: join the 2 parts, leave only a non-split task left
            manager.Join(part1, part2);
            Assert.IsTrue(!manager.IsSplit(split));
            Assert.IsTrue(!manager.IsPart(part1));
            Assert.IsTrue(!manager.IsPart(part2));
            Assert.IsTrue(split.Duration == 2);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:24,代码来源:ProjectTest.cs

示例5: JoinPartFromDifferentSplitTask

        public void JoinPartFromDifferentSplitTask()
        {
            IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
            var split1 = new Task();
            var part1a = new Task();
            var part1b = new Task();
            var split2 = new Task();
            var part2a = new Task();
            var part2b = new Task();
            manager.Add(split1);
            manager.Add(split2);

            // setup: create 2 split tasks
            manager.Split(split1, part1a, part1b, 1);
            manager.Split(split2, part2a, part2b, 1);
            Assert.IsTrue(manager.IsSplit(split1));
            Assert.IsTrue(manager.IsSplit(split2));
            Assert.IsTrue(manager.IsPart(part1a));
            Assert.IsTrue(manager.IsPart(part1b));
            Assert.IsTrue(manager.IsPart(part2a));
            Assert.IsTrue(manager.IsPart(part2b));
            Assert.IsTrue(manager.PartsOf(split1).Count() == 2);
            Assert.IsTrue(manager.PartsOf(split1).Contains(part1a));
            Assert.IsTrue(manager.PartsOf(split1).Contains(part1b));
            Assert.IsTrue(manager.PartsOf(split2).Count() == 2);
            Assert.IsTrue(manager.PartsOf(split2).Contains(part2a));
            Assert.IsTrue(manager.PartsOf(split2).Contains(part2b));

            // test: join part1x with part2x (no effect)
            manager.Join(part1a, part2a);
            Assert.IsTrue(manager.IsSplit(split1));
            Assert.IsTrue(manager.IsSplit(split2));
            Assert.IsTrue(manager.IsPart(part1a));
            Assert.IsTrue(manager.IsPart(part1b));
            Assert.IsTrue(manager.IsPart(part2a));
            Assert.IsTrue(manager.IsPart(part2b));
            Assert.IsTrue(manager.PartsOf(split1).Count() == 2);
            Assert.IsTrue(manager.PartsOf(split1).Contains(part1a));
            Assert.IsTrue(manager.PartsOf(split1).Contains(part1b));
            Assert.IsTrue(manager.PartsOf(split2).Count() == 2);
            Assert.IsTrue(manager.PartsOf(split2).Contains(part2a));
            Assert.IsTrue(manager.PartsOf(split2).Contains(part2b));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:43,代码来源:ProjectTest.cs

示例6: JoinPartConfirmSchedule

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

            // setup: create a 3 part split
            manager.SetStart(split, 16);
            manager.SetDuration(split, 24);
            manager.Split(split, part1, part2, 8);
            manager.Split(part2, part3, 8);
            Assert.IsTrue(manager.IsSplit(split));
            Assert.IsTrue(manager.PartsOf(split).Count() == 3);
            Assert.IsTrue(part1.Duration == 8);
            Assert.IsTrue(part2.Duration == 8);
            Assert.IsTrue(part3.Duration == 8);
            Assert.IsTrue(split.Duration == 26);
            Assert.IsTrue(split.Start == 16);
            Assert.IsTrue(split.End == 42);

            // setup: join parts 1 and 2, intentionally in bad order, but should still work
            manager.Join(part2, part1);
            Assert.IsTrue(manager.IsSplit(split));
            Assert.IsTrue(manager.PartsOf(split).Count() == 2);
            Assert.IsTrue(part2.Duration == 16);
            Assert.IsTrue(part3.Duration == 8);
            Assert.IsTrue(split.Duration == 26); // schedule of other parts not affected
            Assert.IsTrue(split.Start == 16);
            Assert.IsTrue(split.End == 42);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:33,代码来源:ProjectTest.cs

示例7: JoinNullPart

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

            // test: two nulls (no effect)
            manager.Join(null, null);
            Assert.IsTrue(manager.Tasks.Count() == 0);

            // test: null existing
            manager.Join(null, task);
            Assert.IsTrue(!manager.IsPart(task));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:13,代码来源:ProjectTest.cs

示例8: JoinIntoMerge

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

            // setup: create a split task
            manager.Split(split, part1, part2, 7);
            Assert.IsTrue(manager.IsSplit(split));
            Assert.IsTrue(manager.IsPart(part1));
            Assert.IsTrue(manager.IsPart(part2));

            // test: join the two parts, resulting in split becoming back ito regular task
            manager.Join(part1, part2);
            Assert.IsTrue(!manager.IsSplit(split));
            Assert.IsTrue(!manager.IsPart(part1));
            Assert.IsTrue(!manager.IsPart(part2));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:20,代码来源:ProjectTest.cs


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