Esempio n. 1
0
 public static bool IsEqualTo(this DriveInfo thisDrive, ToolStripItem item)
 {
     if (item == null || thisDrive == null)
     {
         return(false);
     }
     return(thisDrive.IsEqualTo(item.Tag as DriveInfo));
 }
Esempio n. 2
0
            private bool RestoreSelectedDrive(ToolStripItem[] newMenuItems)
            {
                if (_selectedDrive == null)
                {
                    return(false);
                }

                var itemToSelect = newMenuItems.FirstOrDefault(item => _selectedDrive.IsEqualTo(item));

                if (itemToSelect == null)
                {
                    return(false);
                }

                itemToSelect.Select();

                return(true);
            }