Esempio n. 1
0
        private void UpdateCounters()
        {
            if (!bConnected)
            {
                return;
            }
            String strValue = string.Empty;

            int nValue = 0;

            foreach (ListViewItem objItem in listCounters.Items)
            {
                XenCounter objCounter = (XenCounter)objItem.Tag;

                if (bMonitorHost == false)
                {
                    nValue = objXen.GetPerfData(lstVMs[comboVMs.SelectedIndex], objCounter.m_nCounter, objCounter.m_strContext);
                }
                else
                {
                    nValue = objXen.GetPerfData(string.Empty, objCounter.m_nCounter, objCounter.m_strContext);
                }

                if (objXen.LastError != 0L)
                {
                    strValue = objXen.GetErrorDescription(objXen.LastError);
                }
                else
                {
                    strValue = objXen.TranslatePerfData(objCounter.m_nCounter, nValue);
                }

                objItem.SubItems[2].Text = strValue;
            }
        }