private void RefreshAvailableProjects(ProjectNamesResult projectNames) { string[] allProjectNames = projectNames.PrivateProjects.Concat(projectNames.PublicProjects).ToArray(); service.SetAvailableProjects(allProjectNames); AvailableProjects = new List <ProjectNameAndFontWeight>(); var projectNamesAndWeight = new List <ProjectNameAndFontWeight>(); foreach (var projectName in projectNames.PrivateProjects) { projectNamesAndWeight.Add(new ProjectNameAndFontWeight(projectName, FontWeights.Bold)); } string tutorials = ""; foreach (var projectName in projectNames.PublicProjects) { if (projectName == "DeltaEngine.Tutorials") { tutorials = projectName; continue; } projectNamesAndWeight.Add(new ProjectNameAndFontWeight(projectName, FontWeights.Normal)); } AvailableProjects.AddRange(projectNamesAndWeight); if (!string.IsNullOrEmpty(tutorials)) { AvailableProjects.Add(new ProjectNameAndFontWeight(tutorials, FontWeights.Normal)); } RaisePropertyChanged("AvailableProjects"); }
public void CanCreateProjectNamesResult() { var privateProjects = new[] { "PrivateProject", "AnotherPrivateProject" }; var publicProjects = new[] { "PublicProject" }; var projectNamesResult = new ProjectNamesResult(privateProjects, publicProjects); Assert.AreEqual(privateProjects.Length, projectNamesResult.PrivateProjects.Length); Assert.AreEqual(publicProjects.Length, projectNamesResult.PublicProjects.Length); }
public void CanCreateProjectNamesResult() { var privateProjects = new[] { "PrivateProject", "AnotherPrivateProject" }; var publicProjects = new[] { "PublicProject" }; var projectNamesResult = new ProjectNamesResult(privateProjects, publicProjects); Assert.AreEqual(privateProjects.Length, projectNamesResult.PrivateProjects.Length); Assert.AreEqual(publicProjects.Length, projectNamesResult.PublicProjects.Length); }