Beispiel #1
0
        // event handlers and methods
        async static void PollStatus()
        {
            var status = await Task.Run(() => TaskHandlers.Status());

            if (status != null)
            {
                UpdateClusterStatusMenu(status);
            }
        }
Beispiel #2
0
        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;
            }
        }