// // [PolicyPermission(System.Security.Permissions.SecurityAction.Demand, PolicyId = PermissionPolicyIdentifiers.AlterIdentity)] internal static void Lock(GenericDeviceParms parms) { if (parms.DeviceId == null) { throw new InvalidOperationException("Must specify a device id"); } foreach (var un in parms.DeviceId) { var user = m_client.GetDevices(o => o.Name == un).CollectionItem.FirstOrDefault() as SecurityDeviceInfo; if (user == null) { throw new KeyNotFoundException($"Device {un} not found"); } m_client.DeleteDevice(user.Entity.Key.Value); } }