/// <summary>
        /// Generates a sample version manifest JSON text.
        /// </summary>
        /// <returns>A sample version manifest in JSON format</returns>
        public static string GenerateSampleJson()
        {
            VersionManifest manifest = new VersionManifest
            {
                Versions = new List <VersionManifestEntry>
                {
                    new VersionManifestEntry
                    {
                        Version     = new Version(1, 0),
                        InfoUri     = "http://example.com/v1.0/whats_new.html",
                        DownloadUri = "http://example.com/v1.0/release.zip"
                    },
                    new VersionManifestEntry
                    {
                        Version     = new Version(1, 0, 3, 2),
                        DownloadUri = "http://example.com/v1.0.3.2/release.tar.gz"
                    },
                    new VersionManifestEntry
                    {
                        Version = new Version(1, 1),
                        InfoUri = "http://example.com/v1.1/whats_new.php"
                    },
                    new VersionManifestEntry
                    {
                        Version = new Version(1, 1, 5)
                    }
                }
            };

            return(JsonConvert.SerializeObject(manifest, Formatting.Indented));
        }
        /// <summary>
        /// Updates the internal version manifest by querying the QueryUri.
        /// </summary>
        /// <returns>True if the current version is outdated.</returns>
        /// <example>
        ///
        /// // Create a new UpdateChecker that queries the specified URI with the CurrentVersion defined as 1.0
        /// UpdateChecker checker = new UpdateChecker("http://convex.st4r.io/sample/version.manifest");
        ///
        /// // Check for an update, and print.
        /// Console.WriteLine(checker.CheckForUpdates() ? "Update is available!" : "Latest version is in use.");
        ///
        /// </example>
        public bool CheckForUpdates()
        {
            WebClient client = new WebClient();

            if (Headers != null)
            {
                client.Headers = Headers;
            }
            string manifest = client.DownloadString(QueryUri);

            versionManifest = JsonConvert.DeserializeObject <VersionManifest>(manifest);
            return(CurrentVersion < LatestVersion);
        }