Exemplo n.º 1
0
        public static void SetProjectsForHost(string host, IEnumerable <Tuple <string, bool> > projects,
                                              UserDefinedSettings settings)
        {
            Dictionary <string, string> selectedProjects = settings.SelectedProjects;

            DictionaryStringHelper.UpdateRawDictionaryString(
                new Dictionary <string, IEnumerable <Tuple <string, string> > >
            {
                { host, projects.Select(y => new Tuple <string, string>(y.Item1, y.Item2.ToString())) }
            },
                selectedProjects);
            settings.SelectedProjects = selectedProjects;
        }
Exemplo n.º 2
0
        public static void InitializeSelectedProjects(IEnumerable <HostInProjectsFile> projects,
                                                      UserDefinedSettings settings)
        {
            if (projects == null)
            {
                return;
            }

            projects = projects
                       .Where(x => !String.IsNullOrEmpty(x.Name) && (x.Projects?.Any() ?? false));
            if (!projects.Any())
            {
                return;
            }

            Dictionary <string, string> selectedProjects = settings.SelectedProjects;

            DictionaryStringHelper.UpdateRawDictionaryString(
                projects.ToDictionary(
                    x => x.Name,
                    x => x.Projects.Select(y => new Tuple <string, string>(y.Path_With_Namespace, bool.TrueString))),
                selectedProjects);
            settings.SelectedProjects = selectedProjects;
        }