public static bool IsEqualTo(this DriveInfo thisDrive, ToolStripItem item) { if (item == null || thisDrive == null) { return(false); } return(thisDrive.IsEqualTo(item.Tag as DriveInfo)); }
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); }