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


C# ProjectManager.Add方法代码示例

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


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

示例1: AdjustDependantScheduleOnRelate

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

            // setup: make 2 independant tasks
            manager.SetStart(one, 10);
            manager.SetDuration(one, 6);
            manager.SetStart(two, 10);
            manager.SetDuration(two, 10);
            Assert.IsTrue(one.Start == 10);
            Assert.IsTrue(one.End == 16);
            Assert.IsTrue(two.Start == 10);
            Assert.IsTrue(two.End == 20);

            // test: relate one and two; one before two
            manager.Relate(one, two);
            Assert.IsTrue(one.Start == 10);
            Assert.IsTrue(one.End == 16);
            Assert.IsTrue(two.Start == 17);
            Assert.IsTrue(two.End == 27);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:25,代码来源:TaskTest.cs

示例2: Form1

        public Form1()
        {
            InitializeComponent();
            // create a project manager
            var manager = new ProjectManager();
            // create built-in task or use your own derived task
            var task = new Braincase.GanttChart.Task() { Name = "Hello "};
            var task1 = new Braincase.GanttChart.Task() { Name = " World" };
            var task2 = new Braincase.GanttChart.Task() { Name = "Helly" };
            var task3 = new Braincase.GanttChart.Task() { Name = "Hel7875" };
            var task5 = new Braincase.GanttChart.Task() { Name = "gmmail" };


            // add the task to the manager
            manager.Add(task2);
            manager.Add(task);
            manager.Add(task1);

            manager.Add(task3);
            manager.Split(task2,task1,2);

            
            //manager.SetDuration(task, 3);
            
            // create a chart control
            var chart = new Chart();
            // initialise the chart with the manager
            chart.Init(manager);
            // add chart to the form controls collection.
            this.Controls.Add(chart);
            
            // throughout your own code, call chart.Invalidate()
            // where you expect updates to the drawn chart,
            // to tell the chart to Paint() itself.
        }
开发者ID:bilale,项目名称:TestVisualStudioGitHub,代码行数:35,代码来源:Form1.cs

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

示例4: AdjustGroupScheduleOnGroup

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

            // setup: set initial task parameters
            manager.SetStart(group, 6);
            manager.SetDuration(group, 5);
            manager.SetStart(one, 9);
            manager.SetEnd(one, 15);
            Assert.IsTrue(group.Start == 6);
            Assert.IsTrue(group.End == 11);
            Assert.IsTrue(one.Start == 9);
            Assert.IsTrue(one.Duration == 6);

            // test: make a group and group make have same parameters as one
            manager.Group(group, one);
            Assert.IsTrue(group.Start == one.Start);
            Assert.IsTrue(group.End == one.End);
            Assert.IsTrue(group.Duration == one.Duration);
            Assert.IsTrue(group.Complete == one.Complete);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:25,代码来源:TaskTest.cs

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

示例6: ExampleSimple

        public ExampleSimple()
        {
            InitializeComponent();

            _mProject = new ProjectManager();
            _mProject.Add(new Task() { Name = "New Task" });
            _mChart.Init(_mProject);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:8,代码来源:ExampleSimple.cs

示例7: AdjustGroupCompleteOnMemberCompleteChange

        public void AdjustGroupCompleteOnMemberCompleteChange()
        {
            IProjectManager<Task, object> manager = new ProjectManager<Task, object>();
            var group = new Task() { Name = "group" };
            var member = new Task() { Name = "member" };
            manager.Add(group);
            manager.Add(member);

            // setup: create a group
            manager.Group(group, member);
            Assert.IsTrue(member.Complete == 0);
            Assert.IsTrue(group.Complete == 0, string.Format("Expected {0} != {1}", 0, group.Complete));

            // test: set the complete on the member and
            manager.SetComplete(member, 0.5f);
            Assert.IsTrue(member.Complete == 0.5f);
            Assert.IsTrue(group.Complete == 0.5f, string.Format("Expected {0} != {1}", 0.5f, group.Complete));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:18,代码来源:TaskTest.cs

示例8: AdjustGroupDurationOnSplit

        public void AdjustGroupDurationOnSplit()
        {
            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);
            Assert.IsTrue(group.Duration == split.Duration);
            Assert.IsTrue(group.End == part2.End);

            // test: split somemore and ensure group duration and end adjust correctly
            manager.Split(part2, part3, 1);
            Assert.IsTrue(group.Duration == split.Duration);
            Assert.IsTrue(group.End == part3.End);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:22,代码来源:ProjectTest.cs

示例9: TestSerialise

		public void TestSerialise() {
			var id = new IdTable();
			var props = new PropertyManager();
			var lessees = new LesseeManager();
			Xml.Write(props, "Properties.xml", id);
			Xml.Write(lessees, "Lessees.xml", id);
			var projects = new ProjectManager();
			projects.Add(new Project());
			projects.Current.Property = props[0];
			projects.Current.CreateCost();
			var fac = projects.Current.Assignments.First(a => a.Flat == props[0].Flats[0]);
			var assignment = new FlatAssignment(projects.Current);
            assignment.Start = DateTime.Now;
            assignment.End = DateTime.Now.AddMonths(3);
			assignment.Lessee = lessees[0];
			fac.Add(assignment);
			Xml.Write(projects, "", id);
		}
开发者ID:Wolfury,项目名称:nebenkosten,代码行数:18,代码来源:XmlTest.cs

示例10: GroupNullTaskIntoGroup

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

            // test: put task into null group (no effect)
            manager.Group(group1, null);
            Assert.IsTrue(manager.Tasks.Count() == 1);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:10,代码来源:ProjectTest.cs

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

示例12: GroupIntoParent

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

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

            // test: grouping into parent (no effect, since already grouped)
            manager.Group(one, group1);
            Assert.IsTrue(manager.IsGroup(group1));
            Assert.IsTrue(!manager.IsGroup(one));
            Assert.IsTrue(manager.ParentOf(one).Equals(group1));
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:17,代码来源:ProjectTest.cs

示例13: GroupKnownTasksAndGroups

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

            var one = new Task();
            var two = new Task();
            var three = new Task();
            var four = new Task();
            var five = new Task();
            var six = new Task();

            manager.Add(one);
            manager.Add(two);
            manager.Add(three);
            manager.Add(four);
            manager.Add(five);
            manager.Add(six);

            // test: groupings
            manager.Group(one, two);
            manager.Group(two, three);
            manager.Group(two, six);
            manager.Group(four, five);
            Assert.IsTrue(manager.IsGroup(one));
            Assert.IsTrue(manager.IsGroup(two));
            Assert.IsTrue(!manager.IsGroup(three));
            Assert.IsTrue(manager.IsGroup(four));
            Assert.IsTrue(!manager.IsGroup(five));
            Assert.IsTrue(!manager.IsGroup(six));

            // test: check task
            Assert.IsTrue(manager.Tasks.Contains(one));
            Assert.IsTrue(manager.Tasks.Contains(two));
            Assert.IsTrue(manager.Tasks.Contains(three));
            Assert.IsTrue(manager.Tasks.Contains(four));
            Assert.IsTrue(manager.Tasks.Contains(five));
            Assert.IsTrue(manager.Tasks.Contains(six));

            // test: check decendants
            Assert.IsTrue(manager.DecendantsOf(four).Contains(five));
            Assert.IsTrue(manager.DecendantsOf(one).Contains(two));
            Assert.IsTrue(manager.DecendantsOf(one).Contains(three));
            Assert.IsTrue(manager.DecendantsOf(one).Contains(six));
            Assert.IsTrue(manager.DecendantsOf(one).Count() == 3);

            // test: check ancestors
            Assert.IsTrue(manager.AncestorsOf(six).Contains(two));
            Assert.IsTrue(manager.AncestorsOf(six).Contains(one));
            Assert.IsTrue(manager.AncestorsOf(six).Count() == 2);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:50,代码来源:ProjectTest.cs

示例14: CreateRelationWithUnknownTasks

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

            // test: non-added dependant (no effect)
            manager.Relate(one, two);
            Assert.IsTrue(manager.HasRelations(one) == false);
            Assert.IsTrue(manager.HasRelations(two) == false);

            // test: non-added precedent (no effect)
            manager.Relate(two, one);
            Assert.IsTrue(manager.HasRelations(one) == false);
            Assert.IsTrue(manager.HasRelations(two) == false);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:17,代码来源:ProjectTest.cs

示例15: GroupIntoGrandParent

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

            // setup: group1 contain group2 contain one
            manager.Group(group1, group2);
            manager.Group(group2, one);

            // test: group into grandparent (allowed)
            manager.Group(group1, one);
            Assert.IsTrue(manager.IsGroup(group1));
            Assert.IsTrue(!manager.IsGroup(group2));
            Assert.IsTrue(!manager.IsGroup(one));
            Assert.IsTrue(manager.ParentOf(one).Equals(group1));
            Assert.IsTrue(manager.ParentOf(group2).Equals(group1));
            Assert.IsTrue(manager.ParentOf(group1) == null);
        }
开发者ID:JackWangCUMT,项目名称:NetGanttControl,代码行数:23,代码来源:ProjectTest.cs


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