public void SaveNewProjectConfig(ProjectConfigItem projectConfig)
        {
            lock (_saveSync)
            {
                projectConfig.ThrowIfNull(nameof(projectConfig));
                projectConfig.Id.ThrowIfNull(nameof(projectConfig.Id));

                var dicAllProjectConfigs = GetAllProjectConfigs();

                if (dicAllProjectConfigs.ContainsKey(projectConfig.Id.ToTrimedInvariant()))
                {
                    throw new Exception(CoreTextResources.ProjectIdIsAlreadyExistException.Replace("[Id]", projectConfig.Id));
                }

                dicAllProjectConfigs.Add(projectConfig.Id.ToTrimedInvariant(), projectConfig);

                SaveProjectConfigsFile(dicAllProjectConfigs);
            }
        }
Example #2
0
 public ProcessResults UpdateProjectConfig(ProjectConfigItem projectConfig, Action <ProcessTrace, StepNotificationState> onNotificationStateChanged)
 {
     return(_updateProjectConfigRunner.Run(new ProjectConfigProcessArgs(projectConfig), onNotificationStateChanged));
 }