public void DoAction(IHost aHost) { if (aHost == null) throw new ArgumentNullException("aHost"); foreach (IDevice device in aHost.GetDevices()) foreach (IPartition partition in device.GetPartitions()) if (partition.IsSystem) { partition.IsProtected = isProtect; return; } }
public void DoAction(IHost aHost) { if (aHost == null) throw new ArgumentNullException("aHost"); foreach (IDevice device in aHost.GetDevices()) foreach (IPartition partition in device.GetPartitions()) foreach(String mountPoint in partition.GetMountPoints()) foreach(String neededMountPoint in mountPoints) if (neededMountPoint.Equals(mountPoint)) { partition.IsProtected = isProtect; break; } }