public override bool Equals(object pObj) { Boolean lRetVal = false; if (pObj != null) { ApplicationRecord lTmp = (ApplicationRecord)pObj; if (this.mAppName == lTmp.AppName && this.mSrcIP == lTmp.mSrcIP) { lRetVal = true; } } return(lRetVal); }
/// <summary> /// /// </summary> public void addRecord(ApplicationRecord pRecord) { if (pRecord != null) { // Check if record already exists foreach (ApplicationRecord lTmp in cRecordList) if (lTmp.ID == pRecord.ID) throw new Exception("Application 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 Exception("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 Exception("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); notify(); } }
/// <summary> /// /// </summary> /// <param name="pRecord"></param> public void addRecord(ApplicationRecord pRecord) { cDomain.addRecord(pRecord); }