Exemplo n.º 1
0
 private BitmapSource GetIcon(RuleGroupViewModel item)
 {
     if (item.ParentConstructor == null)
     {
         return(new BitmapImage(new Uri("pack://application:,,,/Lithnet.Acma.Presentation;component/Resources/RuleGroup.png", UriKind.Absolute)));
     }
     else
     {
         return(new BitmapImage(new Uri("pack://application:,,,/Lithnet.Acma.Presentation;component/Resources/ExecutionConditions.png", UriKind.Absolute)));
     }
 }
Exemplo n.º 2
0
 public void AddExecutionConditions()
 {
     if (this.RuleGroup == null)
     {
         this.Model.RuleGroup = new RuleGroup();
         RuleGroupViewModel vm = new RuleGroupViewModel(this.Model.RuleGroup, true, "Execution rules");
         this.RuleGroup            = vm;
         this.IsExpanded           = true;
         this.RuleGroup.IsExpanded = true;
         this.RuleGroup.IsSelected = true;
     }
 }
Exemplo n.º 3
0
        private static string WriteRuleGroup(RuleGroupViewModel rule, int indentLevel)
        {
            StringBuilder s             = new StringBuilder();
            int           rulePadLength = (indentLevel * 4);

            indentLevel++;

            switch (rule.Operator)
            {
            case GroupOperator.None:
                s.AppendLine(string.Empty.PadRight(rulePadLength) + "None of the following conditions");

                break;

            case GroupOperator.All:
                s.AppendLine(string.Empty.PadRight(rulePadLength) + "All of the following conditions");

                break;

            case GroupOperator.Any:
                s.AppendLine(string.Empty.PadRight(rulePadLength) + "Any of the following conditions");

                break;

            case GroupOperator.One:
                s.AppendLine(string.Empty.PadRight(rulePadLength) + "One of the following conditions");

                break;

            default:
                break;
            }

            for (int i = 0; i < rule.Rules.Count; i++)
            {
                if (rule.Rules[i] is RuleGroupViewModel)
                {
                    s.AppendLine(string.Empty.PadRight(rulePadLength) + DocXExporter.WriteRuleObject(rule.Rules[i], indentLevel));
                }
                else
                {
                    s.AppendLine(string.Empty.PadRight(rulePadLength + 4) + DocXExporter.WriteRuleObject(rule.Rules[i], indentLevel));
                }
            }

            return(s.ToString().TrimEnd('\n'));
        }