public LogsViewModel(IEventBus eventBus) { eventBus.WhenFired <LogEvent>() .Subscribe(x => { Application.Current.Dispatcher.Invoke(() => { LogItems.Add(new LogItemViewModel { Severity = x.Severity, Logger = x.Logger, Message = x.Message }); }); }); CleanLogCommand = new ActionCommand(_ => { LogItems.Clear(); }); LogItems.CollectionChanged += (_, args) => { if (HasNewErrors) { return; } HasNewErrors = args.NewItems?.Cast <LogItemViewModel>() .Any(x => x.Severity >= LogLevel.Error) ?? false; }; Activated.Executed.Subscribe(_ => HasNewErrors = false); Deactivated.Executed.Subscribe(_ => HasNewErrors = false); }
private void OnGUI_Toolbar(int logCount, int warningLogCount, int errorLogCount) { EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); // Left if (GUILayout.Button("Clear", EditorStyles.toolbarButton)) { LogItems.GetInstance()._Clear(); m_FilterModified = true; } m_FilterModified |= m_FocusLastLog.Set(GUILayout.Toggle(m_FocusLastLog, "Focus", EditorStyles.toolbarButton)); m_FilterModified |= m_Collapse.Set(GUILayout.Toggle(m_Collapse, "Collapse", EditorStyles.toolbarButton)); m_FilterModified |= SetFlag(LogType.Log, GUILayout.Toggle(HasFlag(LogType.Log), "L " + logCount, EditorStyles.toolbarButton)); m_FilterModified |= SetFlag(LogType.Warning, GUILayout.Toggle(HasFlag(LogType.Warning), "W " + warningLogCount, EditorStyles.toolbarButton)); m_FilterModified |= SetFlag(LogType.Error, GUILayout.Toggle(HasFlag(LogType.Error), "E " + errorLogCount, EditorStyles.toolbarButton)); GUILayout.FlexibleSpace(); // Right m_FilterModified |= m_LogTagFilter.Set(EditorGUILayout.DelayedTextField(m_LogTagFilter, EditorStyles.toolbarTextField)); m_FilterModified |= m_LogTextFilter.Set(EditorGUILayout.DelayedTextField(m_LogTextFilter, EditorStyles.toolbarTextField)); if (GUILayout.Button("Refresh", EditorStyles.toolbarButton)) { m_FilterModified = true; } EditorGUILayout.EndHorizontal(); }
protected void OnInspectorUpdate() { if (LogItems.GetInstance()._GetLogChanged()) { Repaint(); } }
public async void BrowseLogFilesAndProcess() { var dialog = new CommonOpenFileDialog { IsFolderPicker = true }; if (dialog.ShowDialog() != CommonFileDialogResult.Ok) { return; } StopOtherWork(); LoadingPanel.ShowBrowseLogFilesAndProcessMessage(_currenTokenSource, dialog.FileName); var options = new ProcessingOptions { Directory = dialog.FileName, Parcer = ParcingEngine, LogFileName = Settings.LogFileName, CancellationToken = _currenTokenSource.Token, SearchOption = (Settings.SearchAllDirs) ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly, Config = LogParcerConfig.CurrentConfig }; _analizedData = await Task.Run(() => LogicUtilities.LoadFromDir(options)); var infVM = await GetViewModelCollection(); LoadingPanel.HideBrowseLogFilesAndProcessMessage(); LogItems.Clear(); LogItems.AddRange(infVM); infVM.Clear(); }
public static void Log(string Message, Exception Exception) { LogLock.EnterWriteLock(); LogItems.Add(new LogItem(Message, LogLevels.Exception)); LogLock.ExitWriteLock(); Log(Exception); }
void OnLongSyncProcess() { LogItems.Add("Long SyncProcess triggered"); Thread.Sleep(5000); // Task.Delay just gets overrun LogItems.Add("Long SyncProcess finished"); }
public static void Log(string Message, LogLevels LogLevel = LogLevels.Verbose) { LogLock.EnterWriteLock(); LogItems.Add(new LogItem(Message, LogLevel)); LogLock.ExitWriteLock(); DrawNewLogs(); }
async void OnShortAsyncProcess() { LogItems.Add("Short AsyncProcess triggered"); await Task.Delay(200); LogItems.Add("Short AsyncProcess finished"); }
async void OnLongAsyncProcess() { LogItems.Add("Long AsyncProcess triggered"); await Task.Delay(5000); LogItems.Add("Long AsyncProcess finished"); }
private void AddLogEntry(string message, bool isError = false) { DispatcherHelper.CheckBeginInvokeOnUI(() => { LogItems.Add(new LogEntry(message, isError)); SelectedLogItem = LogItems.Last(); }); }
public void ReportLog(string message) { Application.Current.Dispatcher.Invoke(() => { LogItems.Add(new LogEntry(message)); //Trace.TraceInformation(message); }, DispatcherPriority.Normal); }
private void ScriptiongLogManagerOnLogMessage(object sender, ScriptingMessageEventArgs args) { var messageDate = args.DateTime == DateTime.MinValue ? DateTime.Now : args.DateTime; var message = string.IsNullOrEmpty(args.Writer) ? args.Message : $"{args.Writer}: {args.Message}"; var m = new ScriptingLogItem(messageDate, message); Core.ViewFactory.BeginInvoke(() => LogItems.Insert(0, m)); }
/// <summary> /// Adds the specified LogItemType to the display. /// </summary> /// <param name="type">LogItemType to add</param> /// <history> /// [Curtis_Beard] 12/06/2012 ADD: 1741735, initial dialog for filterable log items viewer. /// [Curtis_Beard] 11/11/2014 CHG: format details display for exclusions /// [Curtis_Beard] 03/02/2015 CHG: set sort to null before add /// [Curtis_Beard] 08/15/2017 FIX: 100, performance changes /// </history> private void AddLogItemType(LogItem.LogItemTypes type) { lstLog.BeginUpdate(); lstLog.ListViewItemSorter = null; var items = LogItems.GetItemsByType(type); foreach (LogItem item in items) { string typeText = Language.GetGenericText(string.Format("LogDisplay.{0}", type), type.ToString()); string valueText = item.Value; string detailsText = item.Details; if (item.ItemType == LogItem.LogItemTypes.Exclusion) { // convert details from format FilterItem~~FilterValue string[] values = Utils.SplitByString(detailsText, "~~"); var filterItem = FilterItem.FromString(values[0]); detailsText = string.Format("{0} -> {1}{2}{3}{4}", Language.GetGenericText(string.Format("Exclusions.{0}", filterItem.FilterType.Category), filterItem.FilterType.Category.ToString()), Language.GetGenericText(string.Format("Exclusions.{0}", filterItem.FilterType.SubCategory), filterItem.FilterType.SubCategory.ToString()), !string.IsNullOrEmpty(filterItem.Value) && filterItem.FilterType.SubCategory != FilterType.SubCategories.Extension ? ", " + values[1] : string.Empty, filterItem.ValueOption != FilterType.ValueOptions.None ? " " + Language.GetGenericText(string.Format("Exclusions.{0}", filterItem.ValueOption), filterItem.ValueOption.ToString()) : string.Empty, !string.IsNullOrEmpty(filterItem.Value) && filterItem.FilterType.SubCategory != FilterType.SubCategories.Extension ? " " + filterItem.Value : string.Empty ); } else if (item.ItemType == LogItem.LogItemTypes.Status) { // Value = Language lookup text (e.g. SearchFinished,SearchCancelled) // Details = 0||1 replacement arguments where 0 is file name or error message, 1 is details string[] values = Utils.SplitByString(detailsText, "||"); valueText = string.Format(Language.GetGenericText(valueText), values); detailsText = string.Empty; if (values.Length > 1) { detailsText = values[1]; } } else if (item.ItemType == LogItem.LogItemTypes.Error) { // Value = Language lookup text (e.g. SearchGenericError, SearchFileError) // Details = 0||1 replacement arguments where 0 = file or empty string, 1 = details (error text) string[] values = Utils.SplitByString(detailsText, "||"); valueText = string.Format(Language.GetGenericText(valueText), values[0]); detailsText = values[1]; } ListViewItem lstItem = new ListViewItem(new string[4] { item.Date.ToShortDateString() + " " + item.Date.ToString("hh:mm:ss.ff tt"), typeText, valueText, detailsText }); lstItem.Tag = item; lstLog.Items.Add(lstItem); } lstLog.ListViewItemSorter = new LogItemComparer(); lstLog.Sort(); lstLog.EndUpdate(); }
public Task OnLogData(LogData data) { LogItems.Clear(); foreach (var item in data.Items.Reverse <LogItem>()) { LogItems.Add(item); } return(Task.FromResult(0)); }
private void FilterLog(BetterQueue <LogItem> logItems) { if (m_FilterModified) { CaculateLogTags(); if (m_Collapse) { m_LogItemHashs.Clear(); } m_FilteredLogIds.Clear(); } int startLogIndex = m_FilterModified ? 0 : Mathf.Max(0, LogItems.GetInstance().LogIdToIndex(m_LastFilterLogId + 1)); m_TopScrollPosition = EditorGUILayout.BeginScrollView(m_TopScrollPosition); for (int iLog = startLogIndex; iLog < logItems.Count; iLog++) { LogItem iterLog = logItems[iLog]; if (!HasFlag(iterLog._LogType)) { continue; } if (m_Collapse && !m_LogItemHashs.Add(iterLog._Hash)) { continue; } if (!string.IsNullOrEmpty(m_LogTagFilter) && (m_IsLogTagExcludeFilter ? m_LogTagFilters.Contains(iterLog.Tag) : !m_LogTagFilters.Contains(iterLog.Tag))) { continue; } if (!string.IsNullOrEmpty(m_LogTextFilter) && !iterLog.Text.Contains(m_LogTextFilter) && !iterLog.ST.Contains(m_LogTextFilter)) { continue; } m_FilteredLogIds.Add(iterLog._Id); } m_LastFilterLogId = logItems.Count > 0 ? logItems[logItems.Count - 1]._Id : -1; m_FilterModified = false; }
private async Task RefreshListViewItems() { LogItems.Clear(); var infVM = await GetViewModelCollection(); LogItems.AddRange(infVM); infVM.Clear(); _listViewIsActual = true; }
public void AddItemsToMenu(GenericMenu menu) { menu.AddItem(EditorGUIUtility.TrTextContent("Reinitialize Style"), false, ReinitializeStyle); menu.AddItem(EditorGUIUtility.TrTextContent("Format SingleLine/Show Timestamp"), LogItems.GetInstance().ShowTimestamp(), LogItems.GetInstance().SwitchShowTimestamp); menu.AddItem(EditorGUIUtility.TrTextContent("Format SingleLine/Show FrameCount"), LogItems.GetInstance().ShowFrameCount(), LogItems.GetInstance().SwitchShowFrameCount); menu.AddItem(EditorGUIUtility.TrTextContent("Format SingleLine/Show LogId"), LogItems.GetInstance().ShowLogId(), LogItems.GetInstance().SwitchShowLogId); menu.AddItem(EditorGUIUtility.TrTextContent("Load From File"), false, LogItems.GetInstance().LoadFromFile); }
public void AddLogItem(string stepIndex, string headerText, string logLine = null) { ImportLogItemViewModel importLogItemViewModel = new ImportLogItemViewModel(stepIndex, headerText); if (logLine != null) { importLogItemViewModel.LogLine = logLine; } LogItems.Add(importLogItemViewModel); }
public MainWindowViewModelDummy() : base() { LogItems.Add(new LogItemViewModel(new LogItem(0, DateTime.Now, LogLevel.Trace, "MyNLog.App", "Trace example", "in TestLogCommand.ExecuteInternal\nin InjectableCommand`1.Execute\nin CommandHelpers.CriticalExecuteCommandSource\nin MenuItem.InvokeClickAfterRender\nin ExceptionWrapper.InternalRealCall\nin ExceptionWrapper.TryCatchWhen\nin DispatcherOperation.InvokeImpl\nin DispatcherOperation.InvokeInSecurityContext\nin CulturePreservingExecutionContext.CallbackWrapper\nin ExecutionContext.RunInternal", ""))); LogItems.Add(new LogItemViewModel(new LogItem(1, DateTime.Now, LogLevel.Debug, "MyNLog.Appp", "Trace example", "in TestLogCommand.ExecuteInternal\nin InjectableCommand`1.Execute\nin CommandHelpers.CriticalExecuteCommandSource\nin MenuItem.InvokeClickAfterRender\nin ExceptionWrapper.InternalRealCall\nin ExceptionWrapper.TryCatchWhen\nin DispatcherOperation.InvokeImpl\nin DispatcherOperation.InvokeInSecurityContext\nin CulturePreservingExecutionContext.CallbackWrapper\nin ExecutionContext.RunInternal", ""))); LogItems.Add(new LogItemViewModel(new LogItem(2, DateTime.Now, LogLevel.Info, "MyNLog.Apppp", "Trace example", "in TestLogCommand.ExecuteInternal\nin InjectableCommand`1.Execute\nin CommandHelpers.CriticalExecuteCommandSource\nin MenuItem.InvokeClickAfterRender\nin ExceptionWrapper.InternalRealCall\nin ExceptionWrapper.TryCatchWhen\nin DispatcherOperation.InvokeImpl\nin DispatcherOperation.InvokeInSecurityContext\nin CulturePreservingExecutionContext.CallbackWrapper\nin ExecutionContext.RunInternal", ""))); LogItems.Add(new LogItemViewModel(new LogItem(3, DateTime.Now, LogLevel.Warn, "MyNLog.Appppp", "Trace example", "in TestLogCommand.ExecuteInternal\nin InjectableCommand`1.Execute\nin CommandHelpers.CriticalExecuteCommandSource\nin MenuItem.InvokeClickAfterRender\nin ExceptionWrapper.InternalRealCall\nin ExceptionWrapper.TryCatchWhen\nin DispatcherOperation.InvokeImpl\nin DispatcherOperation.InvokeInSecurityContext\nin CulturePreservingExecutionContext.CallbackWrapper\nin ExecutionContext.RunInternal", "System.NotImplementedException: Метод или операция не реализована.\n в MyNLog.Services.LogFileService.OpenFile(String fileName) в C:\\Projects\\Desktop\\MyNLog\\MyNLog\\Services\\LogFileService.cs:строка 14\n в MyNLog.Commands.OpenLogFileCommand.ExecuteInternal(Object parameter) в C:\\Projects\\Desktop\\MyNLog\\MyNLog\\Commands\\OpenLogFileCommand.cs:строка 32"))); LogItems.Add(new LogItemViewModel(new LogItem(4, DateTime.Now, LogLevel.Error, "MyNLog.Apppppp", "Trace example", "in TestLogCommand.ExecuteInternal\nin InjectableCommand`1.Execute\nin CommandHelpers.CriticalExecuteCommandSource\nin MenuItem.InvokeClickAfterRender\nin ExceptionWrapper.InternalRealCall\nin ExceptionWrapper.TryCatchWhen\nin DispatcherOperation.InvokeImpl\nin DispatcherOperation.InvokeInSecurityContext\nin CulturePreservingExecutionContext.CallbackWrapper\nin ExecutionContext.RunInternal", "System.NotImplementedException: Метод или операция не реализована.\n в MyNLog.Services.LogFileService.<string, string>OpenFile(String fileName) в C:\\Projects\\Desktop\\MyNLog\\MyNLog\\Services\\LogFileService.cs:строка 14\n в MyNLog.Commands.OpenLogFileCommand.ExecuteInternal(Object parameter) в C:\\Projects\\Desktop\\MyNLog\\MyNLog\\Commands\\OpenLogFileCommand.cs:строка 32"))); LogItems.Add(new LogItemViewModel(new LogItem(5, DateTime.Now, LogLevel.Fatal, "MyNLog.App", "Trace example", "in TestLogCommand.ExecuteInternal\nin InjectableCommand`1.Execute\nin CommandHelpers.CriticalExecuteCommandSource\nin MenuItem.InvokeClickAfterRender\nin ExceptionWrapper.InternalRealCall\nin ExceptionWrapper.TryCatchWhen\nin DispatcherOperation.InvokeImpl\nin DispatcherOperation.InvokeInSecurityContext\nin CulturePreservingExecutionContext.CallbackWrapper\nin ExecutionContext.RunInternal", "System.NotImplementedException: Метод или операция не реализована.\n в MyNLog.Services.LogFileService.OpenFile(String fileName) в C:\\Projects\\Desktop\\MyNLog\\MyNLog\\Services\\LogFileService.cs:строка 14\n в MyNLog.Commands.OpenLogFileCommand.ExecuteInternal(Object parameter) в C:\\Projects\\Desktop\\MyNLog\\MyNLog\\Commands\\OpenLogFileCommand.cs:строка 32"))); LogItems.Add(new LogItemViewModel(new LogItem(6, DateTime.Now, LogLevel.Trace, "MyNLog.App", "Trace example", "in TestLogCommand.ExecuteInternal\nin InjectableCommand`1.Execute\nin CommandHelpers.CriticalExecuteCommandSource\nin MenuItem.InvokeClickAfterRender\nin ExceptionWrapper.InternalRealCall\nin ExceptionWrapper.TryCatchWhen\nin DispatcherOperation.InvokeImpl\nin DispatcherOperation.InvokeInSecurityContext\nin CulturePreservingExecutionContext.CallbackWrapper\nin ExecutionContext.RunInternal", ""))); }
private async void RefreshList() { var results = await _pokeApiService.GetFeedAsync(LogItems.Select(li => li.Id).Max(), 1); foreach (var logitem in results) { LogItems.Insert(0, logitem); } IsLoading = false; }
public void AddLogEntry(string action, string description) { DateTime dt = DateTime.Now; LogItems temp = new LogItems { actionTime = dt.ToShortDateString() + "-" + dt.ToShortTimeString() }; temp.actionName = action; temp.actionDescription = description; logData.Add(temp); }
public void ApplyFilters() { DispatcherHelper.CheckBeginInvokeOnUI(() => { FilteredLogItemsView.Clear(); FilteredLogItemsView = new ObservableCollection <LogItem>(LogItems.Where(GetFilteredItem)); if (FilteredLogItemsView.Any()) { SelectedLogItem = FilteredLogItemsView.Last(); } }); }
/// <summary> /// Setup the form. /// </summary> /// <param name="sender">system parameter</param> /// <param name="e">system parameter</param> /// <history> /// [Curtis_Beard] 12/06/2012 ADD: 1741735, initial dialog for filterable log items viewer. /// [Curtis_Beard] 11/11/2014 CHG: set width of columns, language calls for column names, support null for DefaultFilterType /// [Curtis_Beard] 03/02/2015 CHG: add counts to tabs /// [Curtis_Beard] 03/03/2015 CHG: 93, load column widths from user settings /// </history> private void frmLogDisplay_Load(object sender, EventArgs e) { // safety check if (LogItems == null || LogItems.Count == 0) { this.Close(); } Language.ProcessForm(this); // column names aren't supported in Language class lstLog.Columns[0].Text = Language.GetGenericText("LogDisplay.Column.Date", "Date"); lstLog.Columns[1].Text = Language.GetGenericText("LogDisplay.Column.Type", "Type"); lstLog.Columns[2].Text = Language.GetGenericText("LogDisplay.Column.Value", "Value"); lstLog.Columns[3].Text = Language.GetGenericText("LogDisplay.Column.Details", "Details"); // set column widths from user settings lstLog.Columns[0].Width = Core.GeneralSettings.LogDisplayColumnDateWidth; lstLog.Columns[1].Width = Core.GeneralSettings.LogDisplayColumnTypeWidth; lstLog.Columns[2].Width = Core.GeneralSettings.LogDisplayColumnValueWidth; lstLog.Columns[3].Width = Core.GeneralSettings.LogDisplayColumnDetailsWidth; // do counts after Language.ProcessForm to get language specific text. sbtnStatus.Text = string.Format("{0} ({1})", sbtnStatus.Text, LogItems.FindAll(l => l.ItemType == LogItem.LogItemTypes.Status).Count); sbtnExclusions.Text = string.Format("{0} ({1})", sbtnExclusions.Text, LogItems.FindAll(l => l.ItemType == LogItem.LogItemTypes.Exclusion).Count); sbtnError.Text = string.Format("{0} ({1})", sbtnError.Text, LogItems.FindAll(l => l.ItemType == LogItem.LogItemTypes.Error).Count); if (DefaultFilterType.HasValue) { switch (DefaultFilterType) { case LogItem.LogItemTypes.Status: sbtnExclusions.Checked = sbtnError.Checked = false; sbtnStatus.Checked = true; break; case LogItem.LogItemTypes.Exclusion: sbtnError.Checked = sbtnStatus.Checked = false; sbtnExclusions.Checked = true; break; case LogItem.LogItemTypes.Error: sbtnExclusions.Checked = sbtnStatus.Checked = false; sbtnError.Checked = true; break; } } else { // show all sbtnExclusions.Checked = sbtnError.Checked = sbtnStatus.Checked = true; } }
public override async void Init(object initData) { base.Init(initData); var results = await _pokeApiService.GetFeedAsync(); LogItems.Clear(); foreach (var logitem in results) { LogItems.Add(logitem); } }
public ItemTrackerSettings() : base() { EnablePickit.AddDependency(this); UseTelekinesis.AddDependency(EnablePickit); EnableTelepick.AddDependency(EnablePickit); TeleBack.AddDependency(EnableTelepick); TownPick.AddDependency(EnablePickit); LogRunes.AddDependency(this); LogSets.AddDependency(this); LogUniques.AddDependency(this); LogItems.AddDependency(this); }
public void Finish() { if (!LoggingInProgress) { throw new Exception("There is no logging in progress."); } LoggingInProgress = false; EndTime = DateTime.Now; CurrentLogItem.TrainingTimeInMilliseconds = (EndTime - StartTime).TotalMilliseconds; LogItems.Add(CurrentLogItem); CurrentLogItem = null; WriteToLogFile(); }
protected void OnEnable() { m_WindowId = 0; while (true) { bool has = false; for (int iConsole = 0; iConsole < ms_LogConsoleWindows.Count; iConsole++) { if (ms_LogConsoleWindows[iConsole].GetWindowId() == m_WindowId) { has = true; break; } } if (!has) { break; } m_WindowId++; } ms_LogConsoleWindows.Add(this); LogItems.GetInstance(); titleContent.text = "Console " + m_WindowId; m_SplitterState = UnityEditorReflectionUtility.SplitterGUILayout.CreateSplitterState(new float[] { 70, 30 }, new int[] { 32, 32 }, null); m_LogItemHashs = new HashSet <string>(); m_LogTagFilters = new HashSet <string>(); m_LogTagFilters = new HashSet <string>(); m_FilteredLogIds = new List <int>(); m_SelectedLogId = NOT_SET_LOGITEM_ID; m_LastSelectedLogId = NOT_SET_LOGITEM_ID; m_Collapse = new PrefsValue <bool>("LogConsoleWindow_m_Collapse" + m_WindowId, false); m_LogTypeFlagFilter = new PrefsValue <int>("LogConsoleWindow_m_LogTypeFlagFilter" + m_WindowId, int.MaxValue); m_LogTagFilter = new PrefsValue <string>("LogConsoleWindow_m_LogTagFilter" + m_WindowId, string.Empty); m_FocusLastLog = new PrefsValue <bool>("LogConsoleWindow_m_FocusLastLog" + m_WindowId, false); m_LogTextFilter = new PrefsValue <string>("LogConsoleWindow_m_LogTextFilter" + m_WindowId, string.Empty); m_FilterModified = true; m_LastFilterLogId = 0; CaculateLogTags(); m_TextWithHyperlinks = new System.Text.StringBuilder(); UnityEditorReflectionUtility.EditorGUI.Remove_HyperLinkClicked(OnHyperLinkClicked); UnityEditorReflectionUtility.EditorGUI.Add_HyperLinkClicked(OnHyperLinkClicked); }
private void OnMessageReceivedEvent(ILogMessage msg) { while (LogItems.Count > 10000) { LogItems.RemoveAt(LogItems.Count - 1); } var uiText = string.Format("{0} {1} : {2}", msg.TimeStamp.ToString("HH:mm:ss").PadRight(8, ' '), msg.LogType.ToString().PadRight(8, ' '), msg.LogText); LogItems.Insert(0, uiText); }
/// <summary> /// If configuration is set to Async, adds log items to the processing queue /// </summary> /// <param name="item">LogItem to log</param> internal void AddToQueue(ILogItem item) { try { if (LogItems.Count < MaxQueueSize) { LogItems.Enqueue(item); } } catch (Exception) { // Do nothing if add to Queue failed } }
private void OnNestedProcess() { var num = ProcessNumber++; LogItems.Add("Nested Process triggered"); Task.Run(() => { Thread.Sleep(5000); _dispatcher.Invoke(() => LogItems.Add("Process in NestedProcess finished")); }); LogItems.Add("Nested Process finished"); }
public static void IncrementEvent(LogItems logItem) { IncrementEvent(logItem, 1); }
public static void IncrementEvent(LogItems logItem, int count) { Query q = new Query(); q.QueryCondition=new And( new Q(PageTime.Columns.LogItem,logItem), new Q(PageTime.Columns.Date,DateTime.Today) ); q.Columns=new ColumnSet(PageTime.Columns.K,PageTime.Columns.Impressions); q.NoLock=true; Bobs.PageTimeSet pts = new PageTimeSet(q); if (pts.Count>0) { Cambro.Misc.Db.Qu("UPDATE PageTime SET Impressions=Impressions+" + count.ToString() + " WHERE K="+pts[0].K.ToString()); } else { try { Bobs.PageTime pt = new Bobs.PageTime(); pt.Date = DateTime.Now.Date; pt.LogItem = logItem; pt.Impressions = 1; pt.Update(); } catch { } } }