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"); } TraceLogsDS.ArgixLogTableRow row = (TraceLogsDS.ArgixLogTableRow)rows[0]; entry = new TraceLogEntry(row, this.mMediator); entry.Changed += new EventHandler(OnEntryChanged); } } catch (Exception ex) { throw new ApplicationException("Unexpected error getting trace log entry.", ex); } return(entry); }
public TraceLogEntry(TraceLogsDS.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 new ApplicationException("Unexpected error creating new TraceLogEntry instance.", ex); } }