public void CheckTopics(List <string> labels) { //use it to read from DDI(process to put a check in the checkbox) List <string> otherLabels = new List <string>(); foreach (string label in labels) { CheckOption option = CheckOption.FindByLabel <CheckOption>(Topics, label); if (option != null) { option.IsChecked = true; } else { otherLabels.Add(label); } } if (otherLabels.Count > 0) { //If labels that do not match exists, take only the first one CheckOption option = CheckOption.FindMemoOption(Topics); option.IsChecked = true; option.Memo = otherLabels.First(); } }
public void CheckAreas(List <string> labels) { foreach (string label in labels) { CheckOption option = CheckOption.FindByLabel <CheckOption>(Areas, label); if (option != null) { option.IsChecked = true; } } }
public static void Merge(List <CheckOption> fromOptions, List <CheckOption> toOptions) { foreach (CheckOption toOption in toOptions) { CheckOption fromOption = Option.FindByLabel <CheckOption>(fromOptions, toOption.Label); if (fromOption != null) { toOption.IsChecked = fromOption.IsChecked; toOption.Memo = fromOption.Memo; } } }
public static Coverage CreateDefault() { Coverage coverage = new Coverage(); foreach (Option option in Options.CoverageTopics) { CheckOption checkOption = new CheckOption(option.Code, option.Label); if (option.Code == Options.COVERAGE_TOPIC_OTHER_CODE) { checkOption.HasMemo = true; } coverage.Topics.Add(checkOption); } foreach (Option option in Options.CoverageAreas) { CheckOption checkOption = new CheckOption(option.Code, option.Label); coverage.Areas.Add(checkOption); } return(coverage); }
public string GetGeographicId(CheckOption areaOption) { return(IDUtils.ToId(areaOption.Code, GeographicIdSuffix)); }
public CheckOptionVM(BaseVM parent, CheckOption checkOption) : base(parent) { this.checkOption = checkOption; }
public string GetGeographicStructureId(CheckOption areaOption) { return IDUtils.ToId(areaOption.Code, GeographicStructureIdSuffix); }
public static Coverage CreateDefault() { Coverage coverage = new Coverage(); foreach (Option option in Options.CoverageTopics) { CheckOption checkOption = new CheckOption(option.Code, option.Label); if (option.Code == Options.COVERAGE_TOPIC_OTHER_CODE) { checkOption.HasMemo = true; } coverage.Topics.Add(checkOption); } foreach (Option option in Options.CoverageAreas) { CheckOption checkOption = new CheckOption(option.Code, option.Label); coverage.Areas.Add(checkOption); } return coverage; }