Пример #1
0
        public DataSet ToDataSet()
        {
            //Return a dataset containing values for this object
            ScannerDS ds = null;

            try {
                ds = new ScannerDS();
                ScannerDS.ArgixLogTableRow logEntry = ds.ArgixLogTable.NewArgixLogTableRow();
                logEntry.ID       = this._id;
                logEntry.Name     = this._name;
                logEntry.Level    = this._level;
                logEntry.Date     = this._date;
                logEntry.Source   = this._source;
                logEntry.Category = this._category;
                logEntry.Event    = this._event;
                logEntry.User     = this._user;
                logEntry.Computer = this._computer;
                logEntry.Keyword1 = this._keyword1;
                logEntry.Keyword2 = this._keyword2;
                logEntry.Keyword3 = this._keyword3;
                logEntry.Message  = this._message;
                ds.ArgixLogTable.AddArgixLogTableRow(logEntry);
            }
            catch (Exception) { }
            return(ds);
        }
Пример #2
0
        public TraceLogEntry Item(int id)
        {
            //Return an existing log entry from the log collection
            TraceLogEntry entry = null;

            try {
                //Merge from collection (dataset)
                if (id > 0)
                {
                    DataRow[] rows = this.mLogEntries.ArgixLogTable.Select("ID=" + id);
                    if (rows.Length == 0)
                    {
                        throw new ApplicationException("Log entry for id=" + id + " does not exist in this log table!\n");
                    }
                    ScannerDS.ArgixLogTableRow row = (ScannerDS.ArgixLogTableRow)rows[0];
                    entry          = new TraceLogEntry(row, this.mMediator);
                    entry.Changed += new EventHandler(OnEntryChanged);
                }
            }
            catch (Exception ex) { throw ex; }
            return(entry);
        }
Пример #3
0
 public TraceLogEntry(ScannerDS.ArgixLogTableRow logEntry, Mediator mediator)
 {
     //Constructor
     try {
         this.mMediator = mediator;
         if (logEntry != null)
         {
             if (!logEntry.IsIDNull())
             {
                 this._id = logEntry.ID;
             }
             if (!logEntry.IsNameNull())
             {
                 this._name = logEntry.Name;
             }
             if (!logEntry.IsLevelNull())
             {
                 this._level = logEntry.Level;
             }
             if (!logEntry.IsDateNull())
             {
                 this._date = logEntry.Date;
             }
             if (!logEntry.IsSourceNull())
             {
                 this._source = logEntry.Source;
             }
             if (!logEntry.IsCategoryNull())
             {
                 this._category = logEntry.Category;
             }
             if (!logEntry.IsEventNull())
             {
                 this._event = logEntry.Event;
             }
             if (!logEntry.IsUserNull())
             {
                 this._user = logEntry.User;
             }
             if (!logEntry.IsComputerNull())
             {
                 this._computer = logEntry.Computer;
             }
             if (!logEntry.IsKeyword1Null())
             {
                 this._keyword1 = logEntry.Keyword1;
             }
             if (!logEntry.IsKeyword2Null())
             {
                 this._keyword2 = logEntry.Keyword2;
             }
             if (!logEntry.IsKeyword3Null())
             {
                 this._keyword3 = logEntry.Keyword3;
             }
             if (!logEntry.IsMessageNull())
             {
                 this._message = logEntry.Message;
             }
         }
     }
     catch (Exception ex) { throw ex; }
 }