public void Iterate(string resourcePath, Guid workspaceID, Func <ResourceIteratorResult, bool> action, params ResourceDelimiter[] delimiters)
        {
            if (delimiters == null || delimiters.Length == 0 || action == null || string.IsNullOrEmpty(resourcePath))
            {
                return;
            }

            var workspacePath = EnvironmentVariables.GetWorkspacePath(workspaceID);
            var folders       = new List <string> {
                workspacePath
            };

            folders.AddRange(Directory.EnumerateDirectories(workspacePath, "*", SearchOption.AllDirectories));
            foreach (var path in folders.Select(folder => Path.Combine(workspacePath, folder)))
            {
                if (Directory.Exists(path))
                {
                    var files = Directory.GetFiles(path, "*.xml");
                    foreach (var file in files)
                    {
                        if (!string.IsNullOrEmpty(resourcePath))
                        {
                            if (!file.Contains(resourcePath))
                            {
                                continue;
                            }
                        }
                        // XML parsing will add overhead - so just read file and use string ops instead
                        var content        = File.ReadAllText(file);
                        var iteratorResult = new ResourceIteratorResult {
                            Content = content
                        };
                        var delimiterFound = false;
                        foreach (var delimiter in delimiters)
                        {
                            string value;
                            if (delimiter.TryGetValue(content, out value))
                            {
                                delimiterFound = true;
                                iteratorResult.Values.Add(delimiter.ID, value);
                            }
                        }
                        if (delimiterFound)
                        {
                            if (!action(iteratorResult))
                            {
                                return;
                            }
                        }
                    }
                }
            }
        }
        public void Iterate(string resourcePath, Guid workspaceID, Func<ResourceIteratorResult, bool> action, params ResourceDelimiter[] delimiters)
        {
            if(delimiters == null || delimiters.Length == 0 || action == null || string.IsNullOrEmpty(resourcePath))
            {
                return;
            }

            var workspacePath = EnvironmentVariables.GetWorkspacePath(workspaceID);
            var folders = new List<string> { workspacePath };
            folders.AddRange(Directory.EnumerateDirectories(workspacePath, "*", SearchOption.AllDirectories));
            foreach(var path in folders.Select(folder => Path.Combine(workspacePath, folder)))
            {
                if(Directory.Exists(path))
                {
                    var files = Directory.GetFiles(path, "*.xml");
                    foreach(var file in files)
                    {
                        if(!string.IsNullOrEmpty(resourcePath))
                        {
                            if(!file.Contains(resourcePath))
                            {
                                continue;
                            }
                        }
                        // XML parsing will add overhead - so just read file and use string ops instead
                        var content = File.ReadAllText(file);
                        var iteratorResult = new ResourceIteratorResult { Content = content };
                        var delimiterFound = false;
                        foreach(var delimiter in delimiters)
                        {
                            string value;
                            if(delimiter.TryGetValue(content, out value))
                            {
                                delimiterFound = true;
                                iteratorResult.Values.Add(delimiter.ID, value);
                            }
                        }
                        if(delimiterFound)
                        {
                            if(!action(iteratorResult))
                            {
                                return;
                            }
                        }
                    }
                }
            }
        }