private PipelineAction[] createSubActions(Pipeline pipeline, XmlNodeList c)
        {
            var ret = new PipelineAction[c.Count];

            for (int i = 0; i < c.Count; i++)
            {
                XmlElement elt = (XmlElement)c[i];
                elt.SetAttribute("key", Name);
                ret[i] = PipelineAction.Create(pipeline, elt);
            }
            return(ret);
        }
Пример #2
0
        public Pipeline(ImportEngine engine, XmlNode node) : base(node)
        {
            ImportEngine = engine;
            logger       = engine.DebugLog.Clone("pipeline");

            ScriptTypeName        = node.ReadStr("@script", null);
            DefaultConverters     = node.ReadStr("@converters", null);
            DefaultPostProcessors = node.ReadStr("@postprocessors", null);
            DefaultEndpoint       = node.ReadStr("@endpoint", null);
            if (DefaultEndpoint == null)
            {
                if (engine.Endpoints.Count == 1)
                {
                    DefaultEndpoint = engine.Endpoints[0].Name;
                }
                else if (engine.Endpoints.GetByName(Name, false) != null)
                {
                    DefaultEndpoint = Name;
                }
            }
            trace = node.ReadBool("@trace", false);

            AdminCollection <PipelineAction> rawActions = new AdminCollection <PipelineAction>(node, "action", (x) => PipelineAction.Create(this, x), false);

            definedActions = new List <ActionAdmin>();
            for (int i = 0; i < rawActions.Count; i++)
            {
                var      action = rawActions[i];
                String[] keys   = action.Name.SplitStandard();
                for (int k = 0; k < keys.Length; k++)
                {
                    definedActions.Add(new ActionAdmin(keys[k], i, action));
                }
            }
            definedActions.Sort(cbSortAction);

            var templNodes = node.SelectNodes("template");

            templates = new List <PipelineTemplate>(templNodes.Count);
            for (int i = 0; i < templNodes.Count; i++)
            {
                templates.Add(PipelineTemplate.Create(this, templNodes[i]));
            }

            Dump("");
        }