Ejemplo n.º 1
0
        public override bool TryEvaluate(DynamicResources resources, IValue root,
                                         JsonLocationNode lastNode,
                                         IValue current,
                                         ProcessingFlags options,
                                         out IValue result)
        {
            JsonLocationNode?ancestor = lastNode;
            int index = 0;

            while (ancestor != null && index < _ancestorDepth)
            {
                ancestor = ancestor.Parent;
                ++index;
            }

            if (ancestor != null)
            {
                JsonLocation path = new JsonLocation(ancestor);
                IValue       value;
                if (TryGetValue(root, path, out value))
                {
                    return(this.TryEvaluateTail(resources, root, path.Last, value, options, out result));
                }
                else
                {
                    result = JsonConstants.Null;
                    return(true);
                }
            }
            else
            {
                result = JsonConstants.Null;
                return(true);
            }
        }
Ejemplo n.º 2
0
        public override void Select(DynamicResources resources,
                                    IValue root,
                                    JsonLocationNode lastNode,
                                    IValue current,
                                    INodeReceiver receiver,
                                    ProcessingFlags options,
                                    int depth)
        {
            JsonLocationNode?ancestor = lastNode;
            int index = 0;

            while (ancestor != null && index < _ancestorDepth)
            {
                ancestor = ancestor.Parent;
                ++index;
            }

            if (ancestor != null)
            {
                JsonLocation path = new JsonLocation(ancestor);
                IValue       value;
                if (TryGetValue(root, path, out value))
                {
                    this.TailSelect(resources, root, path.Last, value, receiver, options, depth);
                }
            }
        }
Ejemplo n.º 3
0
 public override void Select(DynamicResources resources,
                             IValue root,
                             JsonLocationNode lastNode,
                             IValue current,
                             INodeReceiver receiver,
                             ProcessingFlags options,
                             int depth)
 {
     if (current.ValueKind == JsonValueKind.Array)
     {
         Int32 index = 0;
         foreach (var item in current.EnumerateArray())
         {
             this.TailSelect(resources, root,
                             PathGenerator.Generate(lastNode, index, options),
                             item, receiver, options, depth);
             ++index;
         }
     }
     else if (current.ValueKind == JsonValueKind.Object)
     {
         foreach (var prop in current.EnumerateObject())
         {
             this.TailSelect(resources, root,
                             PathGenerator.Generate(lastNode, prop.Name, options),
                             prop.Value, receiver, options, depth);
         }
     }
 }
Ejemplo n.º 4
0
 public void Dequeue(ProcessingFlags flags)
 {
     lock (_lock)
     {
         _queue &= ~flags;
     }
 }
Ejemplo n.º 5
0
 public abstract void Select(DynamicResources resources,
                             IValue root,
                             JsonLocationNode lastNode,
                             IValue current,
                             INodeReceiver receiver,
                             ProcessingFlags options,
                             int depth);
Ejemplo n.º 6
0
        private bool CheckEntity(ProcessingFlags pProcessingFlags, out string pReport)
        {
            bool reportOnlyIssues = pProcessingFlags.HasFlag(ProcessingFlags.JustReportIssues);
            // bool showAddonContents = pProcessingFlags.HasFlag(ProcessingFlags.ShowAddonContents);
            string versionString = null;

            try
            {
                byte[] headerBytes = File.ReadAllBytes(AbsolutePath);

                versionString = GetVersionString(headerBytes);
                if (versionString == null)
                {
                    pReport = $"{ErrorTokenString} Invalid file/unknown format";
                    return(false);
                }

                if (!versionString.StartsWith("6."))
                {
                    pReport = $"{ErrorTokenString} Format not importable [{versionString}]";
                    return(false);
                }
            }
            catch
            {
            }


            pReport = $"OK [{versionString}]";

            return(true);
        }
Ejemplo n.º 7
0
        public static Configuration EnableProcessors(this Configuration that,
                                                     ProcessingFlags processingFlags = Configuration.AllProcessingFlags)
        {
            that.Accept(container => {
                if ((processingFlags & ProcessingFlags.Command) == ProcessingFlags.Command)
                {
                    container.RegisterType <IProcessor, CommandConsumer>("command");
                }
                if ((processingFlags & ProcessingFlags.Event) == ProcessingFlags.Event)
                {
                    container.RegisterType <IProcessor, EventConsumer>("event");
                }
                if ((processingFlags & ProcessingFlags.PublishableException) == ProcessingFlags.PublishableException)
                {
                    container.RegisterType <IProcessor, PublishableExceptionConsumer>("exception");
                }
                if ((processingFlags & ProcessingFlags.Query) == ProcessingFlags.Query)
                {
                    container.RegisterType <IProcessor, QueryConsumer>("query");
                }
                if ((processingFlags & ProcessingFlags.Result) == ProcessingFlags.Result)
                {
                    container.RegisterType <IProcessor, ResultConsumer>("result");
                }
            });

            return(that);
        }
Ejemplo n.º 8
0
        public static Configuration UseLocalQueue(this Configuration that, ProcessingFlags flags = Configuration.AllProcessingFlags)
        {
            that.Accept(container =>
            {
                if ((flags & ProcessingFlags.Command) == ProcessingFlags.Command)
                {
                    container.RegisterType <IMessageBus <ICommand>, MessageProducer <ICommand> >();
                    container.RegisterType <IMessageReceiver <Envelope <ICommand> >, MessageProducer <ICommand> >();
                }
                if ((flags & ProcessingFlags.Event) == ProcessingFlags.Event)
                {
                    container.RegisterType <IMessageBus <IEvent>, MessageProducer <IEvent> >();
                    container.RegisterType <IMessageReceiver <Envelope <IEvent> >, MessageProducer <IEvent> >();
                }
                if ((flags & ProcessingFlags.PublishableException) == ProcessingFlags.PublishableException)
                {
                    container.RegisterType <IMessageBus <IPublishableException>, MessageProducer <IPublishableException> >();
                    container.RegisterType <IMessageReceiver <Envelope <IPublishableException> >, MessageProducer <IPublishableException> >();
                }
                if ((flags & ProcessingFlags.Query) == ProcessingFlags.Query)
                {
                    container.RegisterType <IMessageBus <IQuery>, MessageProducer <IQuery> >();
                    container.RegisterType <IMessageReceiver <Envelope <IQuery> >, MessageProducer <IQuery> >();
                }
                if ((flags & ProcessingFlags.Result) == ProcessingFlags.Result)
                {
                    container.RegisterType <IMessageBus <IResult>, MessageProducer <IResult> >();
                    container.RegisterType <IMessageReceiver <Envelope <IResult> >, MessageProducer <IResult> >();
                }
            });


            return(that.EnableProcessors(flags));
        }
Ejemplo n.º 9
0
 public bool InProgress(ProcessingFlags flags)
 {
     lock (_lock)
     {
         return ((_current & flags) != 0);
     }
 }
Ejemplo n.º 10
0
 public void Enqueue(ProcessingFlags flags)
 {
     lock (_lock)
     {
         _queue |= flags;
     }
 }
Ejemplo n.º 11
0
 public void End(ProcessingFlags flags)
 {
     lock (_lock)
     {
         _current &= ~flags;
     }
 }
Ejemplo n.º 12
0
 public override void Select(DynamicResources resources,
                             IValue root,
                             JsonLocationNode lastNode,
                             IValue current,
                             INodeReceiver receiver,
                             ProcessingFlags options,
                             int depth)
 {
     if (current.ValueKind == JsonValueKind.Array)
     {
         if (_index >= 0 && _index < current.GetArrayLength())
         {
             this.TailSelect(resources, root,
                             PathGenerator.Generate(lastNode, _index, options),
                             current[_index], receiver, options, depth);
         }
         else
         {
             Int32 index = current.GetArrayLength() + _index;
             if (index >= 0 && index < current.GetArrayLength())
             {
                 this.TailSelect(resources, root,
                                 PathGenerator.Generate(lastNode, _index, options),
                                 current[index], receiver, options, depth);
             }
         }
     }
 }
Ejemplo n.º 13
0
 public override bool TryEvaluate(DynamicResources resources, IValue root,
                                  JsonLocationNode lastNode,
                                  IValue current,
                                  ProcessingFlags options,
                                  out IValue value)
 {
     return(this.TryEvaluateTail(resources, root, lastNode, current, options, out value));
 }
Ejemplo n.º 14
0
    private ProcessingFlags _queue; // operations queued on this object

    #endregion Fields

    #region Methods

    public void Begin(ProcessingFlags flags)
    {
        lock (_lock)
        {
            _queue &= ~flags;
            _current |= flags;
        }
    }
Ejemplo n.º 15
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="MessageConsumer{TMessage}" /> class.
 /// </summary>
 protected MessageConsumer(IMessageReceiver <Envelope <TMessage> > receiver, CheckHandlerMode checkHandlerMode,
                           ProcessingFlags processingFlag)
     : base(receiver, processingFlag)
 {
     _handlerDescriptors         = new Dictionary <Type, ICollection <HandlerDescriptor> >();
     _envelopeHandlerDescriptors = new Dictionary <Type, ICollection <HandlerDescriptor> >();
     _checkHandlerMode           = checkHandlerMode;
 }
Ejemplo n.º 16
0
        private static bool CheckArguments(string[] pArgs)
        {
            if (pArgs.Length == 0)
            {
                return(false);
            }

            _processingFlags = ProcessingFlags.None;
            foreach (string arg in pArgs)
            {
                if (arg.StartsWith("-"))
                {
                    string argLower = arg.ToLower();
                    if (argLower == "-showaddoncontents" || argLower == "-c")
                    {
                        _processingFlags |= ProcessingFlags.ShowAddonContents;
                        continue;
                    }
                    if (argLower == "-justreportissues" || argLower == "-i")
                    {
                        _processingFlags |= ProcessingFlags.JustReportIssues;
                        continue;
                    }
                    if (argLower == "-listallanimationfiles" || argLower == "-laa")
                    {
                        _processingFlags |= ProcessingFlags.ListAllAnimationFiles;
                        continue;
                    }
                    if (argLower == "-listgesturegaitsanimations" || argLower == "-lga")
                    {
                        _processingFlags |= ProcessingFlags.ListGestureGaitsAnimations;
                        continue;
                    }
                    if (argLower == "-listweirdgesturegaitsverbs" || argLower == "-lw")
                    {
                        _processingFlags |= ProcessingFlags.ListWeirdGestureGaitsVerbs;
                        continue;
                    }
                    if (argLower == "-listcompactdupverbsbyname" || argLower == "-lcdv")
                    {
                        _processingFlags |= ProcessingFlags.ListCompactDupVerbsByName;
                        continue;
                    }
                    if (argLower == "-correctdisguisedfiles" || argLower == "-cdf")
                    {
                        _processingFlags |= ProcessingFlags.CorrectDisguisedFiles;
                        continue;
                    }

                    continue;
                }

                _diskEntity = arg;
            }

            return(_diskEntity != null);
        }
Ejemplo n.º 17
0
 internal JsonSelector(ISelector selector,
                       bool pathsRequired)
 {
     _selector = selector;
     if (pathsRequired)
     {
         _requiredFlags = ProcessingFlags.Path;
     }
 }
Ejemplo n.º 18
0
 public override void Select(DynamicResources resources,
                             IValue root,
                             JsonLocationNode lastNode,
                             IValue current,
                             INodeReceiver receiver,
                             ProcessingFlags options,
                             int depth)
 {
     this.TailSelect(resources, root, lastNode, current, receiver, options, depth);
 }
Ejemplo n.º 19
0
        public override void Select(DynamicResources resources,
                                    IValue root,
                                    JsonLocationNode lastNode,
                                    IValue current,
                                    INodeReceiver receiver,
                                    ProcessingFlags options,
                                    int depth)
        {
            if (current.ValueKind == JsonValueKind.Array)
            {
                Int32 start = _slice.GetStart(current.GetArrayLength());
                Int32 end   = _slice.GetStop(current.GetArrayLength());
                Int32 step  = _slice.Step;

                if (step > 0)
                {
                    if (start < 0)
                    {
                        start = 0;
                    }
                    if (end > current.GetArrayLength())
                    {
                        end = current.GetArrayLength();
                    }
                    for (Int32 i = start; i < end; i += step)
                    {
                        this.TailSelect(resources, root,
                                        PathGenerator.Generate(lastNode, i, options),
                                        current[i], receiver, options, depth);
                    }
                }
                else if (step < 0)
                {
                    if (start >= current.GetArrayLength())
                    {
                        start = current.GetArrayLength() - 1;
                    }
                    if (end < -1)
                    {
                        end = -1;
                    }
                    for (Int32 i = start; i > end; i += step)
                    {
                        if (i < current.GetArrayLength())
                        {
                            this.TailSelect(resources, root,
                                            PathGenerator.Generate(lastNode, i, options),
                                            current[i], receiver, options, depth);
                        }
                    }
                }
            }
        }
Ejemplo n.º 20
0
        private bool CheckEntity(ProcessingFlags pProcessingFlags, out string pReport)
        {
            pReport = null;

            bool reportOnlyIssues = pProcessingFlags.HasFlag(ProcessingFlags.JustReportIssues);
            // bool showAddonContents = pProcessingFlags.HasFlag(ProcessingFlags.ShowAddonContents);


            DirectoryInfo directoryInfo = new DirectoryInfo(EntityPath);

            FileInfo[] addonInfoList = directoryInfo.GetFiles("*.addon", SearchOption.TopDirectoryOnly);

            foreach (FileInfo item in addonInfoList)
            {
                new DiskEntityAddon(item.FullName, ArchivedPath, ReportWriter).CheckEntity(pProcessingFlags);
            }


            FileInfo[] sketchupInfoList = directoryInfo.GetFiles("*.skp", SearchOption.TopDirectoryOnly);

            foreach (FileInfo item in sketchupInfoList)
            {
                new DiskEntitySketchup(item.FullName, null, ReportWriter).CheckEntity(pProcessingFlags);
            }


            FileInfo[] archiveInfoList = directoryInfo.GetFiles("*.zip", SearchOption.TopDirectoryOnly);
            FileInfo[] rarInfoList     = directoryInfo.GetFiles("*.rar", SearchOption.TopDirectoryOnly);
            archiveInfoList = archiveInfoList.Concat(rarInfoList).ToArray();
            FileInfo[] s7InfoList = directoryInfo.GetFiles("*.7z", SearchOption.TopDirectoryOnly);
            archiveInfoList = archiveInfoList.Concat(s7InfoList).ToArray();

            foreach (FileInfo item in archiveInfoList)
            {
                new DiskEntityArchive(item.FullName, ArchivedPath, ReportWriter).CheckEntity(pProcessingFlags);
            }


            if (!pProcessingFlags.HasFlag(ProcessingFlags.FolderTopOnlySearch))
            {
                DirectoryInfo[] subdirectories = directoryInfo.GetDirectories();
                if (subdirectories.Length > 0)
                {
                    foreach (DirectoryInfo subdirectoryInfo in subdirectories)
                    {
                        new DiskEntityFolder(subdirectoryInfo.FullName, null, ReportWriter).CheckEntity(pProcessingFlags);
                    }
                }
            }

            return(true);
        }
Ejemplo n.º 21
0
 static internal JsonLocationNode Generate(JsonLocationNode lastNode,
                                           string identifier,
                                           ProcessingFlags options)
 {
     if ((options & ProcessingFlags.Path) != 0)
     {
         return(new JsonLocationNode(lastNode, identifier));
     }
     else
     {
         return(lastNode);
     }
 }
Ejemplo n.º 22
0
        // ---------------------------------------------------------------------------------------------------------------

        public bool CheckEntity(ProcessingFlags pProcessingFlags, string pNamePrinted = null)
        {
            string report;
            bool   checkOk = CheckEntity(pProcessingFlags, out report);

            if (checkOk && pProcessingFlags.HasFlag(ProcessingFlags.JustReportIssues))
            {
                return(false);
            }

            ReportWriter.WriteReportLineFeed($"{Name} : {report}");
            return(checkOk);
        }
Ejemplo n.º 23
0
 static internal JsonLocationNode Generate(JsonLocationNode lastNode,
                                           Int32 index,
                                           ProcessingFlags options)
 {
     if ((options & ProcessingFlags.Path) != 0)
     {
         return(new JsonLocationNode(lastNode, index));
     }
     else
     {
         return(lastNode);
     }
 }
Ejemplo n.º 24
0
 public ComponentSystem()
 {
     try
     {
         ComponentSystemAttribute attr = AttributeOf(this.GetType());
         this.SystemName       = attr.SystemName;
         this.ProcessingCycles = attr.ProcessingCycles;
         this.ProcessingFlags  = attr.ProcessingFlags;
         this.Watching         = attr.Watching;
         this.Listening        = attr.Listening;
     }
     catch (Exception ex)
     {
         throw new AttributeException(
                   $"Required attribute of class 'ComponentSystemAttribute' not found in derived class '{GetType()}'", ex);
     }
 }
Ejemplo n.º 25
0
 protected bool TryEvaluateTail(DynamicResources resources,
                                IValue root,
                                JsonLocationNode lastNode,
                                IValue current,
                                ProcessingFlags options,
                                out IValue value)
 {
     if (Tail == null)
     {
         value = current;
         return(true);
     }
     else
     {
         return(Tail.TryEvaluate(resources, root, lastNode, current, options, out value));
     }
 }
Ejemplo n.º 26
0
 protected void TailSelect(DynamicResources resources,
                           IValue root,
                           JsonLocationNode lastNode,
                           IValue current,
                           INodeReceiver receiver,
                           ProcessingFlags options,
                           int depth)
 {
     if (Tail == null)
     {
         receiver.Add(lastNode, current);
     }
     else
     {
         Tail.Select(resources, root, lastNode, current, receiver, options, depth);
     }
 }
Ejemplo n.º 27
0
        private bool CheckEntity(ProcessingFlags pProcessingFlags, out string pReport)
        {
            // bool reportOnlyIssues = pProcessingFlags.HasFlag(ProcessingFlags.JustReportIssues);
            // bool showAddonContents = pProcessingFlags.HasFlag(ProcessingFlags.ShowAddonContents);
            pReport = null;

            SevenZipArchiver       archiver = new SevenZipArchiver(AbsolutePath);
            List <ArchiveFileInfo> archiveEntryList;
            List <string>          fileList = GetFileList(archiver, out archiveEntryList);

            if ((fileList?.Count ?? -1) <= 0)
            {
                return(false);
            }

            return(CheckFiles(pProcessingFlags, archiver, archiveEntryList, fileList, out pReport));
        }
Ejemplo n.º 28
0
        // -------------------------------------------------------------------------------------------

        // TODO - Print report
        public bool CheckEntity(ProcessingFlags pProcessingFlags, string pNamePrinted = null)
        {
            ReportWriter.WriteReportLineFeed($"+{Name} : ");
            ReportWriter.IncreaseReportLevel();

            string report;
            bool   checkOk = CheckEntity(pProcessingFlags, out report);

            if (!string.IsNullOrEmpty(report))
            {
                ReportWriter.WriteReportLineFeed(report);
                ReportWriter.DecreaseReportLevel();
                return(checkOk);
            }
            ReportWriter.DecreaseReportLevel();
            ReportWriter.WriteReportLineFeed("");
            return(checkOk);
        }
Ejemplo n.º 29
0
        // ------------------------------------------------------------------------------------------


        public bool CheckEntity(ProcessingFlags pProcessingFlags, string pNamePrinted = null)
        {
            if (IsAddonFolder(EntityPath))
            {
                new DiskEntityAddonFolder(EntityPath, ArchivedPath, ReportWriter).CheckEntity(pProcessingFlags);
                return(true);
            }

            ReportWriter.WriteReportLineFeed($"\n/{Name} :");
            ReportWriter.IncreaseReportLevel();

            string report;
            bool   checkOk = CheckEntity(pProcessingFlags, out report);

            ReportWriter.DecreaseReportLevel();
            ReportWriter.WriteReportLineFeed("");
            return(checkOk);
        }
Ejemplo n.º 30
0
 public override void Select(DynamicResources resources,
                             IValue root,
                             JsonLocationNode lastNode,
                             IValue current,
                             INodeReceiver receiver,
                             ProcessingFlags options,
                             int depth)
 {
     if (current.ValueKind == JsonValueKind.Object)
     {
         IValue value;
         if (current.TryGetProperty(_identifier, out value))
         {
             this.TailSelect(resources, root,
                             PathGenerator.Generate(lastNode, _identifier, options),
                             value, receiver, options, depth);
         }
     }
 }
Ejemplo n.º 31
0
        private bool CheckEntity(ProcessingFlags pProcessingFlags, out string pReport)
        {
            pReport = null;
            bool showDetailedContents = pProcessingFlags.HasFlag(ProcessingFlags.ShowAddonContents);
            bool appendToPackageSet   = pProcessingFlags.HasFlag(ProcessingFlags.AppendToAddonPackageSet);

            if (!showDetailedContents)
            {
                pReport = BriefReport();

                if (!appendToPackageSet)
                {
                    return(true);
                }
            }

            string tempPath = Utils.GetTempDirectory();

            AddonPackage package = new AddonPackage(AbsolutePath, pProcessingFlags, tempPath);

            if (showDetailedContents)
            {
                pReport = package?.ToString();
            }

            if (appendToPackageSet && (AddonPackageSet != null) && (package != null))
            {
                if (package.HasIssues)
                {
                    pReport += " >>> NOT inserted/updated into Catalogue (has problems!)";
                }
                else
                {
                    if (AddonPackageSet.Append(package, pProcessingFlags.HasFlag(ProcessingFlags.AppendToAddonPackageSetForceRefresh)))
                    {
                        pReport += " >>> Inserted/updated into Catalogue";
                    }
                }
            }

            return(true);
        }
Ejemplo n.º 32
0
 public override bool TryEvaluate(DynamicResources resources,
                                  IValue root,
                                  JsonLocationNode lastNode,
                                  IValue current,
                                  ProcessingFlags options,
                                  out IValue result)
 {
     if (resources.TryRetrieveFromCache(_id, out result))
     {
         return(true);
     }
     else
     {
         if (!this.TryEvaluateTail(resources, root, lastNode, root, options, out result))
         {
             result = JsonConstants.Null;
             return(false);
         }
         resources.AddToCache(_id, result);
         return(true);
     }
 }
Ejemplo n.º 33
0
        public void InitializeDatabase()
        {
            Addons = null;

            List <string> files = new List <string>();

            foreach (string folder in Directory.EnumerateDirectories(_moviestormPaths.ContentPacksPath, "*",
                                                                     SearchOption.TopDirectoryOnly))
            {
                files.Add(folder);
            }

            string moddersWorkshop = Path.Combine(_moviestormPaths.AddonsPath, "ModdersWorkshop").ToLower();

            foreach (string folder in Directory.EnumerateDirectories(_moviestormPaths.AddonsPath, "*",
                                                                     SearchOption.TopDirectoryOnly))
            {
                if (folder.ToLower() != moddersWorkshop)
                {
                    files.Add(folder);
                }
            }

            ProcessingFlags processingFlags = ProcessingFlags.AppendToAddonPackageSet |
                                              ProcessingFlags.AppendToAddonPackageSetForceRefresh;

            foreach (string argument in files)
            {
                IDiskEntity asset = DiskEntityHelper.GetEntity(argument, null, new NullReportWriter());

                if (asset == null)
                {
                    continue;
                }
                asset.CheckEntity(processingFlags);
            }

            LastUpdate = DateTime.Now;
        }
Ejemplo n.º 34
0
 public override bool TryEvaluate(DynamicResources resources, IValue root,
                                  JsonLocationNode lastNode,
                                  IValue current,
                                  ProcessingFlags options,
                                  out IValue value)
 {
     if (current.ValueKind == JsonValueKind.Object)
     {
         IValue element;
         if (current.TryGetProperty(_identifier, out element))
         {
             return(this.TryEvaluateTail(resources, root,
                                         PathGenerator.Generate(lastNode, _identifier, options),
                                         element, options, out value));
         }
         else
         {
             value = JsonConstants.Null;
             return(true);
         }
     }
     else if (current.ValueKind == JsonValueKind.Array && _identifier == "length")
     {
         value = new DecimalValue(new Decimal(current.GetArrayLength()));
         return(true);
     }
     else if (current.ValueKind == JsonValueKind.String && _identifier == "length")
     {
         byte[] bytes = Encoding.UTF32.GetBytes(current.GetString().ToCharArray());
         value = new DecimalValue(new Decimal(current.GetString().Length));
         return(true);
     }
     else
     {
         value = JsonConstants.Null;
         return(true);
     }
 }
Ejemplo n.º 35
0
        public override bool TryEvaluate(DynamicResources resources, IValue root,
                                         JsonLocationNode lastNode,
                                         IValue current,
                                         ProcessingFlags options,
                                         out IValue results)
        {
            var           elements = new List <IValue>();
            INodeReceiver receiver = new ValueReceiver(elements);

            if (resources.Options.ExecutionMode == PathExecutionMode.Parallel)
            {
                receiver = new SynchronizedNodeReceiver(receiver);
            }
            Select(resources,
                   root,
                   lastNode,
                   current,
                   receiver,
                   options,
                   0);
            results = new ArrayValue(elements);
            return(true);
        }
Ejemplo n.º 36
0
	/// <summary>
	/// Queues the chunk for processing, passthrough to the background processor
	/// </summary>
	public static void QueueChunk(Chunk chunk, ProcessingFlags flags) {
		if (null == _instance)
			CreateInstance ();
		
		_instance._backgroundProcessor.QueueChunk(chunk, flags);
	}
Ejemplo n.º 37
0
	/// <summary>
	/// Queues the chunk for processing
	/// </summary>
	public void QueueChunk(Chunk chunk, ProcessingFlags flags)
	{
		chunk.processSynchronizer.Enqueue(flags);
		_jobs.Add(chunk);
	}
Ejemplo n.º 38
0
 public bool IsQueued(ProcessingFlags flags)
 {
     lock (_lock)
     {
         return ((_queue & flags) != 0);
     }
 }