BTool.ComPortTreeForm.ChangeActiveRoot C# (CSharp) Method

ChangeActiveRoot() public method

public ChangeActiveRoot ( DeviceForm devForm ) : bool
devForm DeviceForm
return bool
        public bool ChangeActiveRoot(DeviceForm devForm)
        {
            bool flag = false;
            if (devForm != null)
            {
                foreach (TreeNode treeNode in tvPorts.Nodes)
                    treeNode.NodeFont = !(((DeviceInfo)treeNode.Tag).DevName == devForm.devInfo.DevName) ? regularFont : underlineFont;
            }
            else
                flag = false;
            return flag;
        }

Usage Example

Esempio n. 1
0
 private void DeviceChangeActiveRoot(object sender, EventArgs e)
 {
     if (InvokeRequired)
     {
         try
         {
             Invoke((Delegate) new DeviceChangeActiveRootDelegate(DeviceChangeActiveRoot), sender, e);
         }
         catch { }
     }
     else
     {
         m_mutex.WaitOne();
         DeviceForm devForm = sender as DeviceForm;
         if (devForm != null)
         {
             comPortTreeForm.ChangeActiveRoot(devForm);
         }
         m_mutex.ReleaseMutex();
     }
 }