Пример #1
0
 public void UpdateAdapterList()
 {
     if (this.Parent == null)
     {
         return;
     }
     if (flowLayoutPanel1.InvokeRequired)
     {
         ThreadStart ts = new ThreadStart(UpdateAdapterList);
         flowLayoutPanel1.Invoke(ts);
     }
     else
     {
         if (flowLayoutPanel1.Controls.Count == 0)
         {
             foreach (INDISFilter na in ProcessingConfiguration.Instance.NDISFilterList.GetAllAdapters())
             {
                 AdapterDisplay ad = new AdapterDisplay(na.GetAdapterInformation());
                 ad.Width = flowLayoutPanel1.Width - 5;
                 flowLayoutPanel1.Controls.Add(ad);
             }
         }
         else
         {
             foreach (AdapterDisplay ad in flowLayoutPanel1.Controls)
             {
                 ad.UpdateText();
             }
             foreach (INDISFilter na in ProcessingConfiguration.Instance.NDISFilterList.GetNewAdapters())
             {
                 AdapterDisplay ad = new AdapterDisplay(na.GetAdapterInformation());
                 ThemeConfiguration.Instance.SetColorScheme(ad);
                 ad.Width = flowLayoutPanel1.Width - 5;
                 flowLayoutPanel1.Controls.Add(ad);
             }
         }
     }
 }
Пример #2
0
 public void UpdateAdapterList()
 {
     if (this.Parent == null)
     {
         return;
     }
     if (flowLayoutPanel1.InvokeRequired)
     {
         ThreadStart ts = new ThreadStart(UpdateAdapterList);
         flowLayoutPanel1.Invoke(ts);
     }
     else
     {
         if (flowLayoutPanel1.Controls.Count == 0)
         {
             foreach (INDISFilter na in ProcessingConfiguration.Instance.NDISFilterList.GetAllAdapters())
             {
                 AdapterDisplay ad = new AdapterDisplay(na.GetAdapterInformation());
                 ad.Width = flowLayoutPanel1.Width - 5;
                 flowLayoutPanel1.Controls.Add(ad);
             }
         }
         else
         {
             foreach (AdapterDisplay ad in flowLayoutPanel1.Controls)
             {
                 ad.UpdateText();
             }
             foreach (INDISFilter na in ProcessingConfiguration.Instance.NDISFilterList.GetNewAdapters())
             {
                 AdapterDisplay ad = new AdapterDisplay(na.GetAdapterInformation());
                 ThemeConfiguration.Instance.SetColorScheme(ad);
                 ad.Width = flowLayoutPanel1.Width - 5;
                 flowLayoutPanel1.Controls.Add(ad);
             }
         }
     }
 }