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


C# ProjectManager.Unassign方法代码示例

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


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

示例1: UnassignResourceFromAllTask

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

            // setup: assign some resource
            manager.Assign(one, r1);
            manager.Assign(one, r2);
            manager.Assign(two, r1);
            manager.Assign(two, r2);
            Assert.IsTrue(manager.Resources.Count() == 2);
            Assert.IsTrue(manager.ResourcesOf(one).Contains(r1));
            Assert.IsTrue(manager.ResourcesOf(one).Contains(r2));
            Assert.IsTrue(manager.ResourcesOf(two).Contains(r1));
            Assert.IsTrue(manager.ResourcesOf(two).Contains(r2));
            Assert.IsTrue(manager.TasksOf(r1).Contains(one));
            Assert.IsTrue(manager.TasksOf(r2).Contains(one));
            Assert.IsTrue(manager.TasksOf(r1).Contains(two));
            Assert.IsTrue(manager.TasksOf(r2).Contains(two));

            manager.Unassign(r1);
            Assert.IsTrue(manager.Resources.Count() == 1, string.Format("Expected {0} != {1}", 1, manager.Resources.Count()));
            Assert.IsTrue(!manager.ResourcesOf(one).Contains(r1));
            Assert.IsTrue(manager.ResourcesOf(one).Contains(r2));
            Assert.IsTrue(!manager.ResourcesOf(two).Contains(r1));
            Assert.IsTrue(manager.ResourcesOf(two).Contains(r2));
            Assert.IsTrue(!manager.TasksOf(r1).Contains(one));
            Assert.IsTrue(manager.TasksOf(r2).Contains(one));
            Assert.IsTrue(!manager.TasksOf(r1).Contains(two));
            Assert.IsTrue(manager.TasksOf(r2).Contains(two));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:36,代码来源:ProjectTest.cs

示例2: UnassignSpecificResource

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

            // setup: assign some resource
            manager.Assign(one, r1);
            manager.Assign(one, r2);
            Assert.IsTrue(manager.Resources.Count() == 2);
            Assert.IsTrue(manager.ResourcesOf(one).Contains(r1));
            Assert.IsTrue(manager.ResourcesOf(one).Contains(r2));
            Assert.IsTrue(manager.TasksOf(r1).Contains(one));
            Assert.IsTrue(manager.TasksOf(r2).Contains(one));

            // test: unassign resource
            manager.Unassign(one, r2);
            Assert.IsTrue(manager.Resources.Count() == 1);
            Assert.IsTrue(manager.ResourcesOf(one).Contains(r1));
            Assert.IsTrue(!manager.ResourcesOf(one).Contains(r2));
            Assert.IsTrue(manager.TasksOf(r1).Contains(one));
            Assert.IsTrue(!manager.TasksOf(r2).Contains(one));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:25,代码来源:ProjectTest.cs

示例3: UnassignAllResourceFromTask

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

            // setup: assign some resource
            manager.Assign(one, r1);
            manager.Assign(one, r2);
            manager.Assign(two, r1);
            manager.Assign(two, r2);
            Assert.IsTrue(manager.Resources.Count() == 2);
            Assert.IsTrue(manager.ResourcesOf(one).Contains(r1));
            Assert.IsTrue(manager.ResourcesOf(one).Contains(r2));
            Assert.IsTrue(manager.ResourcesOf(two).Contains(r1));
            Assert.IsTrue(manager.ResourcesOf(two).Contains(r2));
            Assert.IsTrue(manager.TasksOf(r1).Contains(one));
            Assert.IsTrue(manager.TasksOf(r2).Contains(one));
            Assert.IsTrue(manager.TasksOf(r1).Contains(two));
            Assert.IsTrue(manager.TasksOf(r2).Contains(two));

            manager.Unassign(one);
            Assert.IsTrue(manager.Resources.Count() == 2);
            Assert.IsTrue(!manager.ResourcesOf(one).Contains(r1));
            Assert.IsTrue(!manager.ResourcesOf(one).Contains(r2));
            Assert.IsTrue(manager.ResourcesOf(two).Contains(r1));
            Assert.IsTrue(manager.ResourcesOf(two).Contains(r2));
            Assert.IsTrue(!manager.TasksOf(r1).Contains(one));
            Assert.IsTrue(!manager.TasksOf(r2).Contains(one));
            Assert.IsTrue(manager.TasksOf(r1).Contains(two));
            Assert.IsTrue(manager.TasksOf(r2).Contains(two));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:36,代码来源:ProjectTest.cs


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