Exemple #1
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            btnRefresh.Enabled = false;
            txtFilter.Enabled  = false;


            LblListMessage.Text = "Loading...";


            _MyCOMAdmin.Refresh();

            _directoryHelperService.GetDlls(txtFilter.Text, (dlls) =>
            {
                mylist.Clear();
                mylist.View       = View.Details;
                mylist.CheckBoxes = true;
                mylist.Columns.Add("Name");
                mylist.Columns.Add("Installed");
                mylist.Columns.Add("PublicKeyToken");
                mylist.Columns.Add("Com+");

                // Populate the data source.
                foreach (var dll in dlls)
                {
                    var item = new ListViewItem(new string[] {
                        dll.Name,
                        dll.Installed.ToString(),
                        dll.PublicKeyToken,
                        _MyCOMAdmin.IsInstalled(dll.Name).ToString()
                    })
                    {
                        Name    = dll.Name,
                        Checked = ItensChekeds.Contains(dll.Name)
                    };

                    mylist.Items.Add(item);
                }
                mylist.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
                mylist.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);

                btnRefresh.Enabled = true;
                txtFilter.Enabled  = true;
                txtFilter.SelectAll();
                txtFilter.Focus();


                RefreshButtonByCheck();
            });
        }