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

            Write(formattedmsg);
        }
Exemplo n.º 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();
        }