ConsoleLog() public méthode

public ConsoleLog ( string message ) : void
message string
Résultat void
Exemple #1
0
        void TryWebCache_CacheDownloaded(object sender, DownloadStringCompletedEventArgs e)
        {
            string result = "";

            try
            {
                // just getting result can raise a 'name could not be resolved' exception
                result = e.Result;
            }
            catch (Exception ex)
            {
                Core.ConsoleLog("Error downloading cache: " + ex.Message);
                return;
            }

            if (string.IsNullOrEmpty(result))
            {
                return;
            }

            WebCacheDownloaded = true; // because there's only 1 web cache, if sucessful, dont try again

            var lines = e.Result.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);

            foreach (var line in lines)
            {
                try
                {
                    Core.Context.AddCache(line);
                }
                catch (Exception ex)
                {
                    Core.ConsoleLog("Error adding cache: " + line + ", " + ex.Message);
                }
            }
        }