Ejemplo n.º 1
0
 public Scrapper(IConfiguration configuration, IHttpClientProvider http, INodeProcessor nodeParser, IGeoAreaFinder areaFinder)
 {
     _configuration = configuration;
     _http          = http;
     _nodeProcessor = nodeParser;
     _areaFinder    = areaFinder;
 }
Ejemplo n.º 2
0
 public PuzzleProcessor(
     IFileUtility fileUtility,
     INodeProcessor nodeProcessor)
 {
     _fileUtility   = fileUtility;
     _nodeProcessor = nodeProcessor;
 }
Ejemplo n.º 3
0
 public WideTree(ISearchCollection <NodeModel> searchMode, INodeProcessor <NodeModel> nodeProcessor, IPrune prune, IThreadPool threadPool)
 {
     this.searchCollection = searchMode;
     this.visitors         = new List <IVisitor>();
     this.prune            = prune;
     this.nodeProcessor    = nodeProcessor;
     this.threadPool       = threadPool;
 }
 /**
  * Traverses through the {@link AssistStructure} and does something at each {@link ViewNode}.
  *
  * @param processor contains action to be performed on each {@link ViewNode}.
  */
 public void Parse(INodeProcessor processor)
 {
     foreach (AssistStructure structure in mStructures)
     {
         int nodes = structure.WindowNodeCount;
         for (int i = 0; i < nodes; i++)
         {
             AssistStructure.ViewNode viewNode = structure.GetWindowNodeAt(i).RootViewNode;
             TraverseRoot(viewNode, processor);
         }
     }
 }
        private void TraverseRoot(AssistStructure.ViewNode viewNode, INodeProcessor processor)
        {
            processor.ProcessNode(viewNode);
            int childrenSize = viewNode.ChildCount;

            if (childrenSize > 0)
            {
                for (int i = 0; i < childrenSize; i++)
                {
                    TraverseRoot(viewNode.GetChildAt(i), processor);
                }
            }
        }
Ejemplo n.º 6
0
        private static void ProcessNode(IAutowireContext context, INodeProcessor processor, Node node)
        {
            try
            {
                context.LogDebug("Processing {} on '{}'.", processor, node);

                processor.Process(context, node);
            }
            catch (Exception e)
            {
                context.LogError(e, "Failed to process {} on '{}'.", processor, node);
            }
        }
Ejemplo n.º 7
0
		/// <summary>
		/// On the server, an easier way to obtain a parser is through the SaltarelleParserFactory class.
		/// </summary>
		public SaltarelleParser(INodeProcessor[] pluginNodeProcessors, IDictionary<string, ITypedMarkupParserImpl> pluginTypedMarkupParsers, IUntypedMarkupParserImpl[] pluginUntypedMarkupParsers) {
			#if CLIENT
				JsDictionary cfg = JsDictionary.GetDictionary(pluginNodeProcessors);
				if (!Script.IsNullOrUndefined(cfg) && cfg.ContainsKey("pluginNodeProcessors")) {
				    // We have an [AlternateSignature] constructor which can cause us to be called with a config object instead of real parameters
                    configObject = cfg;
                    return;
				}
			#endif
			docProcessor = new DocumentProcessor(pluginNodeProcessors, new TypedMarkupParser(pluginTypedMarkupParsers), new UntypedMarkupParser(pluginUntypedMarkupParsers));
			this.pluginNodeProcessors       = pluginNodeProcessors ?? new INodeProcessor[0];
			this.pluginTypedMarkupParsers   = pluginTypedMarkupParsers ?? new Dictionary<string, ITypedMarkupParserImpl>();
			this.pluginUntypedMarkupParsers = pluginUntypedMarkupParsers ?? new IUntypedMarkupParserImpl[0];
		}
        public MutationLibrary(IConnectionProcessor connectionProcessor, INodeProcessor nodeProcessor, IInnovationController innovationController)
        {
            _connectionProcessor  = connectionProcessor;
            _nodeProcessor        = nodeProcessor;
            _innovationController = innovationController;

            if (Mutations.Count != 0)
            {
                return;
            }

            BuildLibrary();

            //_mutations = _mutations.OrderByDescending(m => m.GetWeight).ToList();
            _totalWeight = (int)Mutations.Sum(m => m.GetWeight);
        }
Ejemplo n.º 9
0
        public static void Start(string serviceName)
        {
            try
            {
                _serviceName = serviceName;
#if DEBUG
                //IDbProvider dbProvider = DbProviderFactory.GetDbProvider("OracleClient-2.0");
                //dbProvider.ConnectionString = "Data Source=ORA1;User Id=NODE_2008;Password=memorial;";
                //SpringBaseDao springBaseDao = new SpringBaseDao(dbProvider);

                //springBaseDao.RowExists("NAccount", "*", "Id", "0000-0000-0000-0000-0000");

                //FileTypeIdentifier.Test();
#endif // DEBUG

                SecurityUtils.EnableAllSecurityProtocols(); // TLS 1.2 support

                LOG = LogManagerEx.GetLogger(typeof(WNOSController));
                CreateApplicationEventLog();

                LogInfo("Calling ContextRegistry.GetContext()");
                IApplicationContext ctx = ContextRegistry.GetContext();

                LogInfo("Calling ConfigureRemoting()");
                ConfigureRemoting(ctx);

                LogInfo("Locating centralProcessor");
                _centralProcessor = (INodeProcessor)ctx["centralProcessor"];
                if (_centralProcessor == null)
                {
                    throw new System.Configuration.SettingsPropertyNotFoundException("centralProcessor");
                }
                LogInfo("Starting centralProcessor");
                _centralProcessor.Start();

                LogInfo("Exit WNOSController.Start()");
            }
            catch (Exception e)
            {
                LogError(e, "Exception thrown in WNOSController.Start()");
                throw;
            }
        }
Ejemplo n.º 10
0
        private INode RunProcessor(INode node, INodeProcessor processor, ParseData data, string scope)
        {
            // If the node can be processed, don't touch subnodes - the processor can invoke RunProcessors if it's needed.
            if (processor.ShouldProcess(node, scope))
            {
                var result = processor.Process(this, data, node, scope).ToList();
                return(result.Count == 1 ? result[0] : new NodeCollection(result));
            }

            var children = node.GetChildren();

            for (var i = 0; i < children.Count; i++)
            {
                var child     = children[i];
                var processed = RunProcessor(child, processor, data, scope);
                node.ReplaceChild(i, processed);
            }

            return(node);
        }
Ejemplo n.º 11
0
 public int CompareTo(INodeProcessor other) => ProcessPhase.CompareTo(other.ProcessPhase);
Ejemplo n.º 12
0
 public ObjectWriter(XmlWriter writer, INodeProcessor nodeProcessor)
 {
     this.writer        = writer;
     this.nodeProcessor = nodeProcessor;
 }
Ejemplo n.º 13
0
 public override void Process(INodeProcessor aProcessor)
 {
     aProcessor.Process(this);
 }
Ejemplo n.º 14
0
 public virtual void Process(INodeProcessor aProcessor)
 {
     aProcessor.Process(this);
 }
Ejemplo n.º 15
0
 public NetController(INetworkProcessor networkProcessor, INodeProcessor nodeProcessor, IConnectionProcessor connectionProcessor, IMutationController mutationController) =>
 (_networkProcessor, _nodeProcessor, _connectionProcessor, _mutationController) = (networkProcessor, nodeProcessor, connectionProcessor, mutationController);
 public NetworkProcessor(ISqlDataAccess sqlDataAccess, INodeProcessor nodeProcessor, IConnectionProcessor connectionProcessor) =>
 (_sqlDataAccess, _nodeProcessor, _connectionProcessor) = (sqlDataAccess, nodeProcessor, connectionProcessor);
Ejemplo n.º 17
0
 public NodeProcessorTests()
 {
     _wordUtility   = new WordUtility();
     _wordFilter    = new WordFilter();
     _nodeProcessor = new NodeProcessor(_wordFilter, _wordUtility);
 }
 public AddNodeMutation(INodeProcessor nodeProcessor, IInnovationController innovationController, IConnectionProcessor connectionProcessor)
 {
     _nodeProcessor        = nodeProcessor;
     _innovationController = innovationController;
     _connectionProcessor  = connectionProcessor;
 }