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


C# ProjectManager.IsMember方法代码示例

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


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

示例1: GroupPartsBecomeGroupSplitTask

        public void GroupPartsBecomeGroupSplitTask()
        {
            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: create a split task and a group
            manager.Split(split, part1, part2, 2);
            manager.Group(group, task);
            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));

            // test: group part into task;
            manager.Group(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() == 2);
            Assert.IsTrue(manager.ChildrenOf(group).Contains(task));
            Assert.IsTrue(manager.ChildrenOf(group).Contains(split));

            // test: group task into part (no effect)
            manager.Group(part1, task);
            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.IsGroup(part1));
            Assert.IsTrue(manager.ChildrenOf(group).Count() == 2);
            Assert.IsTrue(manager.ChildrenOf(group).Contains(task));
            Assert.IsTrue(manager.ChildrenOf(group).Contains(split));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:47,代码来源:ProjectTest.cs

示例2: GroupCannotBeRelated

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

            // setup: make a group
            manager.Group(group, member);
            Assert.IsTrue(manager.IsGroup(group));
            Assert.IsTrue(manager.IsMember(member));
            Assert.IsTrue(!manager.HasRelations(one));

            // test: relate a task and a group (not allowed)
            manager.Relate(group, one);
            Assert.IsTrue(manager.IsGroup(group));
            Assert.IsTrue(manager.IsMember(member));
            Assert.IsTrue(!manager.HasRelations(group));
            Assert.IsTrue(!manager.HasRelations(one));

            // test: relate a task and a group, now in another order (not allowed)
            manager.Relate(one, group);
            Assert.IsTrue(manager.IsGroup(group));
            Assert.IsTrue(manager.IsMember(member));
            Assert.IsTrue(!manager.HasRelations(group));
            Assert.IsTrue(!manager.HasRelations(one));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:30,代码来源:ProjectTest.cs

示例3: 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

示例4: 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

示例5: HasRelationTaskCannotBecomeGroup

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

            // setup: create a relation
            manager.Relate(one, two);
            Assert.IsTrue(manager.HasRelations(one));
            Assert.IsTrue(manager.HasRelations(two));

            // test: make a group with another task (not allowed)
            manager.Group(one, member);
            Assert.IsTrue(manager.HasRelations(one));
            Assert.IsTrue(manager.HasRelations(two));
            Assert.IsTrue(!manager.IsGroup(one));
            Assert.IsTrue(!manager.IsMember(member));

            // test: make a group with another task (not allowed)
            manager.Group(two, member);
            Assert.IsTrue(manager.HasRelations(one));
            Assert.IsTrue(manager.HasRelations(two));
            Assert.IsTrue(!manager.IsGroup(two));
            Assert.IsTrue(!manager.IsMember(member));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:29,代码来源:ProjectTest.cs

示例6: SetPartCompleteUpdatesSplitTaskAndGroup

        public void SetPartCompleteUpdatesSplitTaskAndGroup()
        {
            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 member = new Task() { Name = "member" };
            manager.Add(split);
            manager.Add(member);
            manager.Add(group);

            // setup: create split task under a group
            manager.SetDuration(split, 6);
            manager.SetDuration(member, 14);
            manager.Group(group, split);
            manager.Group(group, member);
            manager.Split(split, part1, part2, 2);
            Assert.IsTrue(manager.IsGroup(group));
            Assert.IsTrue(manager.IsMember(member));
            Assert.IsTrue(manager.IsMember(split));

            Assert.IsTrue(group.Complete == 0);
            Assert.IsTrue(split.Complete == 0);
            Assert.IsTrue(part1.Complete == 0);
            Assert.IsTrue(part2.Complete == 0);

            Assert.IsTrue(group.Duration == 14);
            Assert.IsTrue(member.Duration == 14);
            Assert.IsTrue(split.Duration == 7);
            Assert.IsTrue(part1.Duration == 2);
            Assert.IsTrue(part2.Duration == 4);

            // test: set complete for part1 and see group and split complete increase
            manager.SetComplete(part1, 0.3f);
            Assert.IsTrue(Math.Abs(split.Complete - (0.3f * 2) / 6.0f) < 0.01f);
            Assert.IsTrue(Math.Abs(group.Complete - (split.Complete * 7) / 20.0f) < 0.01f);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:38,代码来源:TaskTest.cs


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