void AddVirtualDir(VirtualDirectory vdir, BuildProviderCollection bpcoll, Dictionary <string, bool> cache)
        {
            if (vdir == null)
            {
                return;
            }

            BuildProvider bp;
            IDictionary <string, bool> deps;
            var    dirs = new List <string> ();
            string fileVirtualPath;

            foreach (VirtualFile file in vdir.Files)
            {
                fileVirtualPath = file.VirtualPath;
                if (BuildManager.IgnoreVirtualPath(fileVirtualPath))
                {
                    continue;
                }

                bp = GetBuildProvider(fileVirtualPath, bpcoll);
                if (bp == null)
                {
                    continue;
                }
                if (!AddBuildProvider(bp))
                {
                    continue;
                }

                deps = bp.ExtractDependencies();
                if (deps == null)
                {
                    continue;
                }

                string depDir, s;
                dirs.Clear();
                foreach (var dep in deps)
                {
                    s      = dep.Key;
                    depDir = VirtualPathUtility.GetDirectory(s); // dependencies are assumed to contain absolute paths
                    if (cache.ContainsKey(depDir))
                    {
                        continue;
                    }
                    cache.Add(depDir, true);
                    AddVirtualDir(GetVirtualDirectory(s), bpcoll, cache);
                }
            }
        }
        void AddVirtualFile(VirtualFile file, BuildProviderCollection bpcoll)
        {
            if (file == null || BuildManager.IgnoreVirtualPath(file.VirtualPath))
            {
                return;
            }

            BuildProvider bp = GetBuildProvider(file.VirtualPath, bpcoll);

            if (bp == null)
            {
                return;
            }
            AddBuildProvider(bp);
        }