private CaseSelectRule CreateRule(string ruleCategoryName, bool isSelected) { CaseSelectRule rule = null; rule = new CaseSelectRule() { Name = ruleCategoryName, Status = isSelected ? RuleStatus.Selected : RuleStatus.NotSupported }; return(rule); }
private CaseSelectRule GenerateRule(string ruleName, bool isSupported) { var rule = new CaseSelectRule(); rule.Name = ruleName; if (isSupported) { rule.Status = RuleStatus.Selected; } else { rule.Status = RuleStatus.NotSupported; } return(rule); }
private CaseSelectRule CreateRule(string ruleCategoryName, bool? isSupported) { CaseSelectRule rule = null; if (isSupported == null) { rule = new CaseSelectRule() { Name = ruleCategoryName, Status = RuleStatus.Unknown }; } else { if (isSupported.Value) { rule = new CaseSelectRule() { Name = ruleCategoryName, Status = RuleStatus.Selected }; } else { rule = new CaseSelectRule() { Name = ruleCategoryName, Status = RuleStatus.NotSupported }; } } return rule; }
private CaseSelectRule CreateRule(string ruleCategoryName, bool? hasFlag = true, DetectResult detectResult = DetectResult.Supported) { CaseSelectRule rule = null; if (hasFlag == null) { switch (detectResult) { case DetectResult.Supported: rule = new CaseSelectRule() { Name = ruleCategoryName, Status = RuleStatus.Selected }; break; case DetectResult.DetectFail: rule = new CaseSelectRule() { Name = ruleCategoryName, Status = RuleStatus.NotSupported }; break; case DetectResult.UnSupported: rule = new CaseSelectRule() { Name = ruleCategoryName, Status = RuleStatus.NotSupported }; break; default: break; } } else if (hasFlag.Value) rule = new CaseSelectRule() { Name = ruleCategoryName, Status = RuleStatus.Selected }; else rule = new CaseSelectRule() { Name = ruleCategoryName, Status = RuleStatus.NotSupported }; return rule; }