//To allow a thread to change stats public void changeFileStats(string text, bool darkmode, long filesize, string sha256) { if (darkmode) { DarkMode(); } windowMaximized = false; textStats = new TextStats(text); textStatsString = string.Empty; fileStatsString = string.Empty; textStatsString += "Character count: " + textStats.GetCharCount().ToString() + '\n'; textStatsString += "Space count: " + textStats.spaceCount().ToString() + '\n'; textStatsString += "Word count: " + textStats.GetWordCount().ToString() + '\n'; textStatsString += "Aproximate read time " + (textStats.GetWordCount() / 300).ToString() + " mins" + '\n'; //Average person can read about 300 words per minute textStatsString += textStats.PoorAdjectivesString() + '\n' + textStats.BadWordCountString() + '\n'; if (filesize > 0) { fileStatsString += "Size on disk: " + filesize + " Bytes" + '\n'; fileStatsString += "SHA256: " + sha256 + '\n'; } StatsTextBlock.Text = textStatsString + fileStatsString; }
public void changeStats(string text, bool darkmode) { if (darkmode) { DarkMode(); } windowMaximized = false; textStats = new TextStats(text); textStatsString = string.Empty; textStatsString += "Character count: " + textStats.GetCharCount().ToString() + '\n'; textStatsString += "Space count: " + textStats.spaceCount().ToString() + '\n'; textStatsString += "Word count: " + textStats.GetWordCount().ToString() + '\n'; textStatsString += "Aproximate read time " + (textStats.GetWordCount() / 300).ToString() + "mins" + '\n'; textStatsString += textStats.PoorAdjectivesString() + '\n' + textStats.BadWordCountString() + '\n'; StatsTextBlock.Text = textStatsString + fileStatsString; }