/// <summary> /// /// </summary> public void addRecord(SystemRecord pRecord) { if (pRecord != null) { // Check if record already exists foreach (SystemRecord lTmp in cRecordList) if (lTmp.ID == pRecord.ID) throw new RecordExistsException("System alrady exists."); if (!Regex.Match(pRecord.SrcMAC.Trim(), @"^[\da-f]{1,2}[\-:][\da-f]{1,2}[\-:][\da-f]{1,2}[\-:][\da-f]{1,2}[\-:][\da-f]{1,2}[\-:][\da-f]{1,2}$", RegexOptions.IgnoreCase).Success) throw new RecordException("Something is wrong with the MAC address"); if (!Regex.Match(pRecord.SrcIP.Trim(), @"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$", RegexOptions.IgnoreCase).Success) throw new RecordException("Something is wrong with the IP address"); cRecordList.Add(pRecord); // Resize the DGV to the defined maximum size. \ while (cRecordList.Count > cMaxTableRows) cRecordList.RemoveAt(0); notifyRecords(); } }
/// <summary> /// /// </summary> /// <param name="pRecord"></param> public void addRecord(SystemRecord pRecord) { cDomain.addRecord(pRecord); }