public static SkillSet find_or_create(string name, string column_name, int minimum_proficiency = 1) { if (!SkillSetConfigurations.Any(item => item.ConfigurationId.DisplayName == name)) { try { var configurations = new SkillSetConfigurationList(new DialerConfigurationManager(Application.ICSession).ConfigurationManager); var skillset = configurations.CreateObject(); skillset.SetDisplayName(name); skillset.ColumnName.Value = column_name; skillset.MinimumProficiency.Value = minimum_proficiency; skillset.Commit(); _SkillSetConfigurations = null; // So the list is fetched again } catch (Exception e) { throw e; } } return(new SkillSet(SkillSetConfigurations.First(item => item.ConfigurationId.DisplayName == name))); }
public static SkillSet find_or_create(string name, string column_name, int minimum_proficiency = 1) { if (! SkillSetConfigurations.Any(item => item.ConfigurationId.DisplayName == name)) { try { var configurations = new SkillSetConfigurationList(new DialerConfigurationManager(Application.ICSession).ConfigurationManager); var skillset = configurations.CreateObject(); skillset.SetDisplayName(name); skillset.ColumnName.Value = column_name; skillset.MinimumProficiency.Value = minimum_proficiency; skillset.Commit(); _SkillSetConfigurations = null; // So the list is fetched again } catch(Exception e) { throw e; } } return new SkillSet(SkillSetConfigurations.First(item => item.ConfigurationId.DisplayName == name)); }