void Service_ClientIpAddressUnlocked(object sender, EventArgs e) { ClientOperationInformation op = (ClientOperationInformation)sender; if (op.HasError) { IntrusionLog.AddEntry(DateTime.Now, IntrusionLog.GetSystemId(), op.IpAddress, IntrusionLog.STATUS_UNLOCK_ERROR, false); } else { IntrusionLog.AddEntry(DateTime.Now, IntrusionLog.GetSystemId(), op.IpAddress, IntrusionLog.STATUS_UNLOCKED, false); } SendInfoMail(sender, LockType.None); }
void OnClientIpAddressUnlocked(Lock lockItem, Exception ex) { if (ClientIpAddressUnlocked != null) { ClientOperationInformation op = new ClientOperationInformation(); op.IpAddress = lockItem.IpAddress; op.Exception = ex; op.AgentId = IntrusionLog.GetSystemId(); if (ex != null) { op.HasError = true; op.Message = "Error while unlocking " + lockItem.IpAddress + ":\r\n" + ex.Message; } else { op.Message = "Client with IP address " + lockItem.IpAddress + " was unlocked"; } ClientIpAddressUnlocked(op, EventArgs.Empty); } }