Beispiel #1
0
        public static Project SampleProject()
        {
            var def = new DefaultsFor2Pipe
            {
                TillTemp = 65,
                ReturTemp = 45
            };
            var part2_1 = new Part2Pipe(def) {Name = "Exempel 1"};

            var childPipe = new NodePipe2Pipe(def) {Name = "N", Direction = Dir.N};
            childPipe.AddChild(new NodePipe2Radiator(def) {Name = "E2", Direction = Dir.E});
            childPipe.AddChild(new NodePipe2Radiator(def) {Name = "W2", Direction = Dir.W});

            part2_1.Root.AddChild(childPipe);
            part2_1.Root.AddChild(new NodePipe2Radiator(def) {Name = "E", Direction = Dir.E});
            part2_1.Root.AddChild(new NodePipe2Radiator(def) {Name = "W", Direction = Dir.W});

            var part2_2 = new Part2Pipe(def) { Name = "Exempel 2" };

            var childPipe2 = new NodePipe2Pipe(def) { Name = "W", Direction = Dir.N };
            childPipe2.AddChild(new NodePipe2Radiator(def) { Name = "W3", Direction = Dir.W });
            childPipe2.AddChild(new NodePipe2Radiator(def) { Name = "N3", Direction = Dir.N });

            var childPipe3 = new NodePipe2Pipe(def) { Name = "N", Direction = Dir.N };
            childPipe3.AddChild(childPipe2);
            childPipe3.AddChild(new NodePipe2Radiator(def) { Name = "E2", Direction = Dir.E });
            childPipe3.AddChild(new NodePipe2Radiator(def) { Name = "N2", Direction = Dir.N });

            part2_2.Root.AddChild(childPipe3);
            part2_2.Root.AddChild(new NodePipe2Radiator(def) { Name = "E", Direction = Dir.E });
            part2_2.Root.AddChild(new NodePipe2Radiator(def) { Name = "W", Direction = Dir.W });

            var proj = new Project
            {
                Name = "Demoobjekt",
                DefaultFor2Pipe = def,
                P2Pipes = new[] { part2_1, part2_2 }.ToList()
            };

            return proj;
        }
Beispiel #2
0
 public Project CreateNewProject(User user)
 {
     var project = new Project();
     _projectRepository.AddProject(project);
     return project;
 }
Beispiel #3
0
 public static User SampleUser(Project project)
 {
     var user = new User(Guid.NewGuid());
     user.Folders.Projects.Add(project.Id, project.Name);
     return user;
 }
Beispiel #4
0
 public void AddProject(Project project)
 {
     _projects.Add(project.Id, project);
 }