Ejemplo n.º 1
0
        //---------------------------------------------------------------------
        private void MPBrowserDialog_Load(object sender, EventArgs e)
        {
            ReadOnlyCollection <ManagementPack> managementPacks;
            ManagementPackCriteria criteria = new ManagementPackCriteria("Sealed=0");

            try
            {
                managementPacks = m_managementGroup.GetManagementPacks(criteria);
            }
            catch (Microsoft.EnterpriseManagement.Common.ServerDisconnectedException)
            {
                m_managementGroup.Reconnect();

                managementPacks = m_managementGroup.GetManagementPacks(criteria);
            }

            lstManagementPacks.BeginUpdate();

            foreach (ManagementPack mp in managementPacks)
            {
                ListViewItem listViewItem = new ListViewItem();

                listViewItem.Text = Common.GetBestManagementPackName(mp);
                listViewItem.Tag  = mp;

                listViewItem.SubItems.Add(mp.Version.ToString());

                lstManagementPacks.Items.Add(listViewItem);

                lstManagementPacks.Sort();
            }

            lstManagementPacks.EndUpdate();
        }