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


C# ProjectManager.Ungroup方法代码示例

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


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

示例1: AdjustGroupDurationOnUngroup

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

            // setup: create a group and split under it
            manager.Split(split, part1, part2, 1);
            manager.Group(group, part1); // intentionall group using part
            manager.Group(group, task);
            manager.SetDuration(part1, 30);
            manager.SetDuration(part2, 15);
            manager.SetDuration(task, 20);
            manager.SetStart(task, 50);
            Assert.IsTrue(group.Duration == 70);

            // test: ungroup part should ungroup split task
            manager.Ungroup(group, part1);
            Assert.IsTrue(group.Duration == 20);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:26,代码来源:ProjectTest.cs

示例2: UngroupUnknownGroup

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

            // setup: make a foreign group
            other.Group(group, one);
            Assert.IsTrue(other.IsGroup(group));
            Assert.IsTrue(manager.Tasks.Count() == 0);

            // test: check whether can ungroup unknown group
            manager.Ungroup(group);
            Assert.IsTrue(other.IsGroup(group));
            Assert.IsTrue(manager.Tasks.Count() == 0);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:19,代码来源:ProjectTest.cs

示例3: UngroupUnknownTasksFromGroup

        public void UngroupUnknownTasksFromGroup()
        {
            IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
            var group = new Task();
            var member = new Task();
            var one = new Task();

            // setup: make only group added
            manager.Add(group);
            manager.Group(group, member);
            Assert.IsTrue(manager.Tasks.Count() == 1);
            Assert.IsTrue(manager.Tasks.Contains(group));

            // test: check that we cannot add unknown tasks to group
            manager.Ungroup(group, one);
            Assert.IsTrue(manager.Tasks.Count() == 1);
            Assert.IsTrue(manager.Tasks.Contains(group));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:18,代码来源:ProjectTest.cs

示例4: UngroupPartShouldUngroupSplitTask

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

            // setup: create a group and split under it
            manager.Split(split, part1, part2, 1);
            manager.Group(group, part1); // intentionall group using part
            Assert.IsTrue(manager.IsGroup(group));
            Assert.IsTrue(manager.IsMember(split));
            Assert.IsTrue(!manager.IsMember(part1));
            Assert.IsTrue(!manager.IsMember(part2));

            // test: ungroup part should ungroup split task
            manager.Ungroup(group, part2);
            Assert.IsTrue(!manager.IsGroup(group));
            Assert.IsTrue(!manager.IsMember(split));
            Assert.IsTrue(!manager.IsMember(part1));
            Assert.IsTrue(!manager.IsMember(part2));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:25,代码来源:ProjectTest.cs

示例5: UngroupTaskFromUnknownGroups

        public void UngroupTaskFromUnknownGroups()
        {
            IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
            IProjectManager<Task, object> other = new ProjectManager<Task, object>();
            var group = new Task();
            var member = new Task();
            var one = new Task();
            other.Add(group);
            other.Add(member);

            // setup: make only one added and foreign group
            manager.Add(one);
            other.Group(group, member);
            Assert.IsTrue(manager.Tasks.Count() == 1);
            Assert.IsTrue(manager.Tasks.Contains(one));

            // test: check that we cannot add tasks to unknown group
            manager.Ungroup(group, one);
            Assert.IsTrue(manager.Tasks.Count() == 1);
            Assert.IsTrue(manager.Tasks.Contains(one));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:21,代码来源:ProjectTest.cs

示例6: UngroupPartBecomeUngroupSplitTask

        public void UngroupPartBecomeUngroupSplitTask()
        {
            IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
            var split = new Task() { Name = "split" };
            var part1 = new Task() { Name = "part1" };
            var part2 = new Task() { Name = "part2" };
            var group = new Task() { Name = "group" };
            var task = new Task() { Name = "task" };
            manager.Add(split);
            manager.Add(group);
            manager.Add(task);

            // setup: group split task into group
            manager.Split(split, part1, part2, 2);
            manager.Group(group, task);
            manager.Group(group, split);
            Assert.IsTrue(manager.IsSplit(split));
            Assert.IsTrue(manager.IsPart(part1));
            Assert.IsTrue(manager.IsPart(part2));
            Assert.IsTrue(manager.IsGroup(group));
            Assert.IsTrue(manager.IsMember(task));
            Assert.IsTrue(!manager.IsMember(part1));
            Assert.IsTrue(manager.IsMember(split));
            Assert.IsTrue(manager.ChildrenOf(group).Count() == 2);
            Assert.IsTrue(manager.ChildrenOf(group).Contains(task));
            Assert.IsTrue(manager.ChildrenOf(group).Contains(split));

            // test: ungroup part from group
            manager.Ungroup(group, part1);
            Assert.IsTrue(manager.IsSplit(split));
            Assert.IsTrue(manager.IsPart(part1));
            Assert.IsTrue(manager.IsPart(part2));
            Assert.IsTrue(manager.IsGroup(group));
            Assert.IsTrue(manager.IsMember(task));
            Assert.IsTrue(!manager.IsMember(part1));
            Assert.IsTrue(!manager.IsMember(split));
            Assert.IsTrue(manager.ChildrenOf(group).Count() == 1);
            Assert.IsTrue(manager.ChildrenOf(group).Contains(task));
            Assert.IsTrue(!manager.ChildrenOf(group).Contains(split));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:40,代码来源:ProjectTest.cs

示例7: UngroupNullTaskFromGroup

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

            // setup: make an actual group first
            manager.Group(group1, one);
            Assert.IsTrue(manager.IsGroup(group1));
            Assert.IsTrue(manager.Tasks.Count() == 2);
            Assert.IsTrue(manager.Tasks.Contains(one));
            Assert.IsTrue(manager.Tasks.Contains(group1));

            // test: ungroup null (no effect)
            manager.Ungroup(group1, null);
            Assert.IsTrue(manager.IsGroup(group1));
            Assert.IsTrue(manager.Tasks.Count() == 2);
            Assert.IsTrue(manager.Tasks.Contains(one));
            Assert.IsTrue(manager.Tasks.Contains(group1));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:22,代码来源:ProjectTest.cs

示例8: UngroupNullGroup

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

            // test: ungroup a null group (no effect, should not throw)
            manager.Ungroup(null);
            Assert.IsTrue(manager.Tasks.Count() == 1);
            Assert.IsTrue(manager.Tasks.Contains(one));

            // test: ungroup a null group with task (no effect, should not throw)
            manager.Ungroup(null, one);
            Assert.IsTrue(manager.Tasks.Count() == 1);
            Assert.IsTrue(manager.Tasks.Contains(one));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:16,代码来源:ProjectTest.cs

示例9: UngroupNonGroup

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

            // test: ungroup a task that wasn't a group in the first place (no effect)
            manager.Ungroup(group1);
            Assert.IsTrue(!manager.IsGroup(group1));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:10,代码来源:ProjectTest.cs

示例10: UngroupAGroup

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

            // setup: group1 contains group2; group2 contains one and two
            manager.Group(group1, group2);
            manager.Group(group2, one);
            manager.Group(group2, two);

            // test: group2 is no longer a group; one and two goes into group 1 (parent of group 2)
            manager.Ungroup(group1);
            Assert.IsTrue(!manager.IsGroup(group1));
            Assert.IsTrue(manager.IsGroup(group2));
            Assert.IsTrue(!manager.IsGroup(one));
            Assert.IsTrue(!manager.IsGroup(two));
            Assert.IsTrue(manager.ChildrenOf(group1).Count() == 0);
            Assert.IsTrue(manager.ChildrenOf(group2).Count() == 2);
            Assert.IsTrue(manager.Tasks.Count() == 4);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:27,代码来源:ProjectTest.cs


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