/// <summary>
        /// When overridden in a derived class, returns a read-only stream to the virtual resource.
        /// </summary>
        /// <returns>
        /// A read-only stream to the virtual file.
        /// </returns>
        public Stream Open()
        {
            // Get this assembly.
            var assembly = typeof(ResourceController).Assembly;
            var output   = EmbeddedResourceHelper.GetResource(assembly, this._virtualPath, out string resourceName);

            if (output != null)
            {
                return(output);
            }

            // We need to loop through the loaded criteria and check each one.
            var localAssembly = assembly;
            var criteria      = PersonalisationGroupMatcher.GetAvailableCriteria()
                                .Where(a => a.GetType().Assembly != localAssembly);

            foreach (var criterion in criteria)
            {
                var resource = EmbeddedResourceHelper.SanitizeCriteriaResourceName(this._virtualPath);

                assembly     = criterion.GetType().Assembly;
                resourceName = assembly.GetManifestResourceNames().FirstOrDefault(r => r.InvariantEndsWith(resource));

                if (!string.IsNullOrWhiteSpace(resourceName))
                {
                    return(EmbeddedResourceHelper.GetResource(assembly, resource, out resourceName));
                }
            }

            return(null);
        }
        /// <summary>
        /// Returns a value indicating whether the virtual file exists for the given path.
        /// </summary>
        /// <param name="virtualPath">The virtual path.</param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public bool FileExists(string virtualPath)
        {
            if (!virtualPath.EndsWith(AppConstants.ResourceExtension, StringComparison.InvariantCultureIgnoreCase))
            {
                return(false);
            }

            return(EmbeddedResourceHelper.ResourceExists(virtualPath));
        }