Пример #1
0
 void DoSequenceOrParallelOrAdd(IActivityMonitor monitor, Action <ActionConfiguration> collector, XElement xml)
 {
     if (xml.Name == "Parallel" || xml.Name == "Sequence")
     {
         Action <ActionConfiguration> elementCollector;
         if (xml.Name == "Parallel")
         {
             var p = new ActionParallelConfiguration(xml.AttributeRequired("Name").Value);
             elementCollector = a => p.AddAction(a);
             collector(p);
         }
         else
         {
             var s = new ActionSequenceConfiguration(xml.AttributeRequired("Name").Value);
             elementCollector = a => s.AddAction(a);
             collector(s);
         }
         foreach (var action in xml.Elements())
         {
             DoSequenceOrParallelOrAdd(monitor, collector, action);
         }
     }
     else
     {
         if (xml.Name != "Add")
         {
             throw new XmlException(String.Format("Unknown element '{0}': only <Add>, <Parallel> or <Sequence>.", xml.Name));
         }
         string type             = xml.AttributeRequired("Type").Value;
         Type   t                = FindConfigurationType(type);
         HandlerConfiguration hC = (HandlerConfiguration)Activator.CreateInstance(t, xml.AttributeRequired("Name").Value);
         hC.DoInitialize(monitor, xml);
         collector(hC);
     }
 }
Пример #2
0
 protected override HandlerBase DoCreateParallel(IActivityMonitor monitor, IRouteConfigurationLock configLock, ActionParallelConfiguration c, HandlerBase[] children)
 {
     return(new ParallelHandler(c, children));
 }
Пример #3
0
 protected override ITestIt DoCreateParallel(IActivityMonitor monitor, IRouteConfigurationLock configLock, ActionParallelConfiguration c, ITestIt[] children)
 {
     return(new TestParallel(monitor, c, children));
 }
Пример #4
0
 public ParallelHandler(ActionParallelConfiguration c, HandlerBase[] children)
     : base(c)
 {
     _children = children;
 }
Пример #5
0
 internal TestParallel(IActivityMonitor m, ActionParallelConfiguration c, ITestIt[] children)
 {
     _name     = c.Name;
     _children = children;
     m.Info().Send("Created Parallel '{0}' with {1} children.", _name, _children.Length);
 }