Inheritance: RuleModelBase
コード例 #1
0
ファイル: AlwaysRuleModel.cs プロジェクト: Kooboo/Ecommerce
        public static AlwaysRuleModel FromRule(AlwaysRule rule)
        {
            var model = new AlwaysRuleModel();
            foreach (var activity in rule.Activities)
            {
                model.Activities.Add(ConfiguredActivityModel.FromConfiguredActivity(activity));
            }

            return model;
        }
コード例 #2
0
        public static AlwaysRuleModel FromRule(AlwaysRule rule)
        {
            var model = new AlwaysRuleModel();

            foreach (var activity in rule.Activities)
            {
                model.Activities.Add(ConfiguredActivityModel.FromConfiguredActivity(activity));
            }

            return(model);
        }
コード例 #3
0
        public static RuleModelBase FromRule(Rule rule)
        {
            if (rule is AlwaysRule)
            {
                return(AlwaysRuleModel.FromRule(rule as AlwaysRule));
            }
            if (rule is IfElseRule)
            {
                return(IfElseRuleModel.FromRule(rule as IfElseRule));
            }
            if (rule is SwitchCaseRule)
            {
                return(SwitchCaseRuleModel.FromRule(rule as SwitchCaseRule));
            }

            throw new NotSupportedException();
        }