void bco_DiscoverDevicesProgress(object sender, DiscoverDevicesEventArgs e)
        {
            Debug.Assert(e.Error == null && !e.Cancelled, "Never raised by BtCompnt!");
            var dlgt = new EventHandler <DiscoverDevicesEventArgs>(UpdateProgressChanged);

            lvDevices.BeginInvoke(dlgt, this, e);
        }
示例#2
0
 public override void WriteLine(string value)
 {
     lst.BeginInvoke((Action)(() =>
     {
         lst.Items.Add(value.ToString());
     }
                              ));
 }
示例#3
0
 public static void listViewAddItem(ListView varListView, ListViewItem item)
 {
     if (varListView.InvokeRequired)
     {
         varListView.BeginInvoke(new MethodInvoker(() => listViewAddItem(varListView, item)));
     }
     else
     {
         varListView.Items.Add(item);
     }
 }
示例#4
0
 /**************************************************************************************************/
 private void SetNewRelativePMH(ListView lv, PastMedicalHistory pmh)
 {
     if (pmh != null)
     {
         if (lv.InvokeRequired)
         {
             lv.BeginInvoke(new NewRelativePmhCallback(SetNewRelativePMH), lv, pmh);
         }
         else
         {
             foreach (ListViewItem lvi in lv.Items)
             {
                 if (lvi.Tag != null)
                 {
                     Person p = (Person)(lvi.Tag);
                     if (pmh.RelativeOwningPMH != null)
                     {
                         if (p == pmh.RelativeOwningPMH)
                         {
                             lvi.SubItems[5].Text = pmh.GerSummaryText();
                             break;
                         }
                     }
                 }
             }
         }
     }
 }
      void showFiles(FilesResult files, ListView listToShow)
      {
        
         listToShow.BeginInvoke(new Action(() =>
         {

            //clear contents
            listToShow.Clear();
            // Create columns for the items and subitems.
            listToShow.Columns.Add("Filename", 400, HorizontalAlignment.Left);
            foreach (var file in files.FilesEntry)
            {
               ListViewItem item = new ListViewItem(file.Label, 0);
               item.Tag = file;
               listToShow.Items.Add(item);
            }

            listToShow.Show();

         }));
         StopProgress();
      }
示例#6
0
 private void AddToList(string sType, string sMessage)
 {
     listViewData.BeginInvoke(new AddStringToMessagesList(AddToMessagesList), new object[] { sType, sMessage });
 }
 private void UpdateListView(ListView view, ListViewItem item)
 {
     if (view.InvokeRequired)
     {
         view.BeginInvoke(new Action<ListView, ListViewItem>(UpdateListView), view, item);
     }
     else
     {
         view.Items.Add(item);
         if (view.Items.Count > 10)
             view.TopItem = view.Items[view.Items.Count - 10];
         view.Update();
         view.Parent.Update();
     }
 }
示例#8
0
文件: Form1.cs 项目: rayviso/Excel-
 private void EnableView(ListView lv, bool bEnable)
 {
     if (lv.InvokeRequired)
                 {
                         dEnableListView d = new dEnableListView(EnableView);
                         lv.BeginInvoke(d, new object[] { lv, bEnable });
                 }
                 else
                 {
                         lv.Enabled = bEnable;
                 }
 }