Esempio n. 1
0
        /// <summary>
        /// Create the filter list
        /// </summary>
        /// <returns></returns>
        internal DataFrameFilterExpression CreateFilters()
        {
            DataFrameFilterExpression filters = new DataFrameFilterExpression(MatchAllFilters);

            if (Filters != null)
            {
                foreach (DataFrameFilterFactory factory in Filters)
                {
                    filters.Add(factory.CreateFilter());
                }
            }

            return(filters);
        }
Esempio n. 2
0
        /// <summary>
        /// Create a new pipeline node based on this factory
        /// </summary>
        /// <param name="graph">The netgraph associated with this node</param>
        /// <param name="logger">The logger associated with the graph</param>
        /// <param name="stateDictionary">A dictionary which can be used to store construction state</param>
        /// <returns>The new node</returns>
        public BasePipelineNode Create(Logger logger, NetGraph graph, Dictionary <string, object> stateDictionary)
        {
            BasePipelineNode node = null;

            try
            {
                node = OnCreate(logger, graph, stateDictionary);
                if (node != null)
                {
                    foreach (var pair in Properties)
                    {
                        node.Properties[pair.Key] = pair.Value;
                    }

                    DataFrameFilterExpression filters = new DataFrameFilterExpression(MatchAllFilters);

                    foreach (DataFrameFilterFactory factory in Filters)
                    {
                        if (factory.Enabled)
                        {
                            filters.Add(factory.CreateFilter());
                        }
                    }

                    node.Filters       = filters;
                    node.Enabled       = Enabled;
                    node.SelectionPath = SelectionPath;
                    node.Hidden        = Hidden;
                    node.LogInput      = LogInput;
                    node.LogOutput     = LogOutput;
                }
            }
            catch (Exception e)
            {
                throw new NodeFactoryException(String.Format(CANAPE.Properties.Resources.BaseNodeFactory_Create, this.Label, e.Message), e);
            }

            return(node);
        }