// event handlers and methods async static void PollStatus() { var status = await Task.Run(() => TaskHandlers.Status()); if (status != null) { UpdateClusterStatusMenu(status); } }
async private void GetStatus(object sender, EventArgs e) { var status = await Task.Run(() => TaskHandlers.Status()); if (status != null) { var cacheFolderPath = string.Format("{0}\\.crc\\cache", Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)); if (status.CrcStatus != "") { CrcStatus.Text = status.CrcStatus; } if (status.OpenshiftStatus != "") { OpenShiftStatus.Text = string.Format("{0} (v{1})", status.OpenshiftStatus, status.OpenshiftVersion); } DiskUsage.Text = string.Format("{0} of {1} (Inside the CRC VM)", FileSize.HumanReadable(status.DiskUse), FileSize.HumanReadable(status.DiskSize)); CacheUsage.Text = FileSize.HumanReadable(GetFolderSize.SizeInBytes(cacheFolderPath)); CacheFolder.Text = cacheFolderPath; } }