internal static List <IronTrace> GetPreviousScanTraceRecords(int JumpLevel) { List <IronTrace> Records = new List <IronTrace>(); int CurrentMin = IronTrace.ScanTraceMin; int JumpCount = IronLog.GetJumpCount(JumpLevel); if (CurrentMin <= 1) { IronUI.ShowScanTraceStatus("Reached beginning of the log. Cannot go back further.", true); return(Records); } int StartIndex = CurrentMin - IronLog.MaxRowCount - JumpCount - 1; Records = IronDB.GetScanTraces(StartIndex, IronLog.MaxRowCount); return(Records); }
static void StartModuleOnSession(object ModuleDisplayNameSourceLogId) { List <object> Args = (List <object>)ModuleDisplayNameSourceLogId; string ModuleDisplayName = Args[0].ToString(); string Source = Args[1].ToString(); int LogId = (int)Args[2]; Session Sess = IronLog.GetLog(Source, LogId); //switch (Source) //{ // case(RequestSource.Proxy): // Sess = Session.FromProxyLog(LogId); // break; // case (RequestSource.Probe): // Sess = Session.FromProbeLog(LogId); // break; // case (RequestSource.Scan): // Sess = Session.FromScanLog(LogId); // break; // case (RequestSource.Shell): // Sess = Session.FromShellLog(LogId); // break; // case (RequestSource.Test): // case (RequestSource.TestGroup): // Sess = Session.FromTestLog(LogId); // break; // default: // Sess = Session.FromLog(LogId, Source); // break; //} if (Sess != null) { Module M = GetModuleFromDisplayName(ModuleDisplayName, SESSION); if (M != null) { M.ThreadId = IronThread.ThreadId; M.StartModuleOnSession(Sess); } } }
internal static List <IronTrace> GetNextScanTraceRecords(int JumpLevel) { int JumpCount = IronLog.GetJumpCount(JumpLevel); int StartIndex = IronTrace.ScanTraceMax + JumpCount; List <IronTrace> Records = IronDB.GetScanTraces(StartIndex, IronLog.MaxRowCount); if (Records.Count == 0) { int NewStartIndex = Config.LastScanTraceId - IronLog.MaxRowCount; if (NewStartIndex > 0) { Records = IronDB.GetScanTraces(NewStartIndex, IronLog.MaxRowCount); if (Records.Count > 0) { if (Records[Records.Count - 1].ID == IronTrace.ScanTraceMax) { Records.Clear(); } } } } return(Records); }