コード例 #1
0
ファイル: DomainFacade.cs プロジェクト: vaginessa/Simsang
        /// <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();
              }
        }
コード例 #2
0
ファイル: TaskFacade.cs プロジェクト: vaginessa/Simsang
 /// <summary>
 /// 
 /// </summary>
 /// <param name="pRecord"></param>
 public void addRecord(SystemRecord pRecord)
 {
     cDomain.addRecord(pRecord);
 }