public void WriteDefaultValueToXElement(XElement target, object defaultValue)
        {
            if (defaultValue == null) {
                WriteDefaultValueToXElement(target);
                return;
            }

            if (!(defaultValue is string)) {
                throw new InvalidOperationException("Default value for configuration item of type TokenSelection must be string.");
            }
            string pattern = (string)defaultValue;
            TokenSelection value = new TokenSelection(pattern);
            WriteToXElement(target, value);
        }
Пример #2
0
 public static CbrNodeConfiguration CreateCbr(string name, string testedMessage, NodeConfiguration defaultTarget, params CbrCase[] cases)
 {
     var testedMessageSelection = new TokenSelection(
         string.Format(@"/token/messages/message[@name='{0}']/*[1]", testedMessage));
     var result = new CbrNodeConfiguration() {
         Name = name,
         TestedSelection = testedMessageSelection,
         DefaultTarget = defaultTarget
     };
     foreach (CbrCase cbrCase in cases) {
         result.Branches.Add(
             new XrmUri(string.Format(@"//item[@name='{0}']", cbrCase.Schematron)),
             cbrCase.TargetNode);
     }
     return result;
 }
Пример #3
0
 public CbrNodeConfiguration()
 {
     Branches = new Dictionary<XrmUri, NodeConfiguration>();
     TestedSelection = new TokenSelection(string.Empty);
 }
 public TerminatorNodeConfiguration()
 {
     ResultMessageSelection = new TokenSelection(string.Empty);
 }
 public void WriteDefaultValueToXElement(XElement target)
 {
     TokenSelection defaultValue = new TokenSelection();
     WriteToXElement(target, defaultValue);
 }
        public TokenSelectionEditor()
        {
            InitializeComponent();

            Selection = new TokenSelection();
        }