public void SettingProjectSetsChildrenProjects()
 {
     var project = new Core.Project();
     var child = new TriggerStub();
     new Multiple(child) { Project = project };
     Assert.AreSame(project, child.Project);
 }
Exemple #2
0
        private static void CMakeLists(Core.Project proj, string rootDirec, string name, Dictionary <string, CMakeProject> cmakes)
        {
            var dict = new Dictionary <string, List <string> >();

            foreach (var filePath in proj.FilePaths)
            {
                var direc = System.IO.Path.GetDirectoryName(filePath);
                if (!dict.ContainsKey(direc))
                {
                    dict[direc] = new List <string>();
                }

                dict[direc].Add(filePath);
            }

            var index = System.IO.Path.GetDirectoryName(rootDirec).Length;

            foreach (var direc in dict.Keys)
            {
                if (direc.IndexOf(rootDirec) != 0)
                {
                    continue;
                }

                var p  = Add(cmakes, direc);
                var p2 = new Core.Project();
                p2.IsExe = proj.IsExe;
                p2.FilePaths.AddRange(dict[direc]);
                p.Projects.Add(p2);
            }
        }
Exemple #3
0
        private string Console(Core.Project project)
        {
            if (!project.IsExe)
            {
                return(string.Empty);
            }

            return(_templates["vcxproj.console"]);
        }
Exemple #4
0
        public void SettingProjectSetsChildrenProjects()
        {
            var project = new Core.Project();
            var child   = new TriggerStub();

            new Multiple(child)
            {
                Project = project
            };
            Assert.AreSame(project, child.Project);
        }
Exemple #5
0
 public void AddProject(Core.Project newProject)
 {
     using (var context = new GoalsContext())
     {
         var project = new Project
         {
             ProjectId = newProject.ProjectId,
             Name      = newProject.Name
         };
         context.Projects.Add(project);
         context.SaveChanges();
     }
 }
Exemple #6
0
        private string References(Core.Project project)
        {
            var references = string.Empty;

            foreach (var library in project.Dependencies)
            {
                if (!_projects.ContainsKey(library))
                {
                    continue;
                }

                var reference = _templates["vcxproj.reference"];
                reference = reference.Replace("{{name}}", library);
                reference = reference.Replace("{{guid}}", _guids[library]);
            }

            return(references);
        }
Exemple #7
0
        static void Main(string[] args)
        {
            Repository rep = new Repository();

            var country = new Core.Country
            {
                CountryId = 1,
                Name      = "United States"
            };

            rep.AddCountry(country);

            var city = new Core.City
            {
                CityId    = 1,
                Name      = "Raccoon City",
                CountryId = rep.GetCountries().FirstOrDefault().CountryId
            };

            rep.AddCity(city);

            var project = new Core.Project
            {
                ProjectId = 1,
                Name      = "Market Forward"
            };

            rep.AddProject(project);

            var user = new Core.User
            {
                UserId    = 1,
                UserName  = "******",
                Password  = "******",
                FirstName = "Leon",
                LastName  = "Kennedy",
                ProjectId = rep.GetProjects().FirstOrDefault().ProjectId,
                CityId    = rep.GetCities().FirstOrDefault().CityId,
                Portrait  = "LeonKennedy.jpg",
                CanReview = false
            };

            rep.AddUser(user);

            var user2 = new Core.User
            {
                UserId    = 2,
                UserName  = "******",
                Password  = "******",
                FirstName = "Claire",
                LastName  = "Redfield",
                ProjectId = rep.GetProjects().FirstOrDefault().ProjectId,
                CityId    = rep.GetCities().FirstOrDefault().CityId,
                Portrait  = "ClaireRedfield.jpg",
                CanReview = true
            };

            rep.AddUser(user2);

            var user3 = new Core.User
            {
                UserName  = "******",
                Password  = "******",
                FirstName = "Ada",
                LastName  = "Wong",
                ProjectId = rep.GetProjects().FirstOrDefault().ProjectId,
                CityId    = rep.GetCities().FirstOrDefault().CityId,
                Portrait  = "AdaWong.jpg",
                CanReview = true
            };

            rep.AddUser(user3);

            var users = rep.GetUsers();

            List <int> userIds = new List <int>();

            foreach (var u in rep.GetUsers())
            {
                userIds.Add(u.UserId);
            }

            var goal = new Core.Goal
            {
                GoalId      = 1,
                UserId      = userIds[0],
                Title       = "Angular",
                Description = "Learn angular 1.5 and create a proof of concept",
                StartDate   = DateTime.Now,
                EndDate     = DateTime.Now,
                Status      = 1,
                ReviewerId  = rep.GetUsers().Where(u => u.CanReview).FirstOrDefault().UserId
            };

            rep.AddGoal(goal);

            var goal2 = new Core.Goal
            {
                GoalId      = 1,
                UserId      = userIds[0],
                Title       = "Xamarin",
                Description = "Learn Xamarin and create an application",
                StartDate   = DateTime.Now,
                EndDate     = DateTime.Now,
                Status      = 1,
                ReviewerId  = rep.GetUsers().Where(u => u.CanReview).FirstOrDefault().UserId
            };

            rep.AddGoal(goal2);

            var goal3 = new Core.Goal
            {
                GoalId      = 1,
                UserId      = userIds[1],
                Title       = "React",
                Description = "Learn React 1.5 and create a proof of concept",
                StartDate   = DateTime.Now,
                EndDate     = DateTime.Now,
                Status      = 1,
                ReviewerId  = rep.GetUsers().Where(u => u.CanReview).FirstOrDefault().UserId
            };

            rep.AddGoal(goal3);

            var goal4 = new Core.Goal
            {
                GoalId      = 1,
                UserId      = userIds[1],
                Title       = "TypeScript",
                Description = "Learn TypeScript and create an application",
                StartDate   = DateTime.Now,
                EndDate     = DateTime.Now,
                Status      = 1,
                ReviewerId  = rep.GetUsers().Where(u => u.CanReview).FirstOrDefault().UserId
            };

            rep.AddGoal(goal4);

            var goal5 = new Core.Goal
            {
                GoalId      = 1,
                UserId      = userIds[2],
                Title       = "JQuery",
                Description = "Learn JQuery and create a project",
                StartDate   = DateTime.Now,
                EndDate     = DateTime.Now,
                Status      = 1,
                ReviewerId  = rep.GetUsers().Where(u => u.CanReview).FirstOrDefault().UserId
            };

            rep.AddGoal(goal5);

            var goal6 = new Core.Goal
            {
                GoalId      = 1,
                UserId      = userIds[2],
                Title       = "JS",
                Description = "Learn advanced javascript an create a proof of concept",
                StartDate   = DateTime.Now,
                EndDate     = DateTime.Now,
                Status      = 1,
                ReviewerId  = rep.GetUsers().Where(u => u.CanReview).FirstOrDefault().UserId
            };

            rep.AddGoal(goal6);


            var goals = rep.GetGoals();
        }
Exemple #8
0
        private void WriteFiles(Core.Project project, string rootDirec)
        {
            if (project.FilePaths.Count == 0)
            {
                return;
            }

            _file.WriteLine("# Set up the IDE");

            var dirName = System.IO.Path.GetFileName(_directory);

            if (dirName.Length == 0)
            {
                dirName = _directory;
            }

            var upper = dirName.ToUpper();

            var headers = new List <string>();
            var sources = new List <string>();

            foreach (var filePath in project.FilePaths)
            {
                if (Core.Cpp.IsHeader(filePath))
                {
                    headers.Add(filePath.Substring(_directory.Length + 1));
                }
                else
                {
                    sources.Add(filePath.Substring(_directory.Length + 1));
                }
            }

            if (sources.Count > 0)
            {
                _file.WriteLine(string.Format("set({0}_SRC_FILES {1})", upper, string.Join(" ", sources)));
            }

            if (headers.Count > 0)
            {
                _file.WriteLine(string.Format("set({0}_HDR_FILES {1})", upper, string.Join(" ", headers)));
            }

            var index  = System.IO.Path.GetDirectoryName(rootDirec).Length;
            var filter = _directory.Substring(index + 1);

            filter = filter.Replace("\\", "\\\\");
            _file.Write(string.Format("source_group({0} FILES", filter));

            if (sources.Count > 0)
            {
                _file.Write(string.Format(" ${{{0}_SRC_FILES}}", upper));
            }

            if (headers.Count > 0)
            {
                _file.Write(string.Format(" ${{{0}_HDR_FILES}}", upper));
            }

            _file.WriteLine(")");
            _file.WriteLine();

            if (sources.Count > 0)
            {
                var lower = dirName.ToLower();
                if (project.IsExe)
                {
                    _file.Write(string.Format("add_executable({0} ${{{1}_SRC_FILES}}", lower, upper));
                }
                else
                {
                    _file.Write(string.Format("add_library({0}lib ${{{1}_SRC_FILES}}", lower, upper));
                }

                if (headers.Count > 0)
                {
                    _file.Write(string.Format(" ${{{0}_HDR_FILES}}", upper));
                }

                _file.WriteLine(")");
            }
        }