Exemple #1
0
        public void AddMessage(AuditTrailMessage msg)
        {
            String severityText = msg.SeverityText;
            String formattedmsg = msg.Date.ToString() + "|" + severityText + "|" + msg.Message;

            Write(formattedmsg);
        }
Exemple #2
0
        /// <summary>
        /// Read the contents of the file into our internal list
        /// </summary>
        protected void Read()
        {
            String lineRead;

            lineRead = _fileReader.ReadLine();
            while (lineRead != null)
            {
                // Process the line read from the file
                lineRead.Trim();

                // Is there anything left to process
                if (lineRead.Length != 0)
                {
                    AuditTrailMessage newMessage = new AuditTrailMessage(lineRead);
                    _listMessages.Add(newMessage);
                }

                // Read the next line and loop back to process it
                lineRead = _fileReader.ReadLine();
            }
            _fileReader.Close();
        }