| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Data;
- namespace SKMC.Api.Common.Logger
- {
- public class LogDataService
- {
- private static LogDataService instance;
- private readonly object lockEventObject = new object();
- private readonly object lockProductionObject = new object();
- private readonly object lockParameterObject = new object();
- private readonly object lockProcessObject = new object();
- private readonly object lockActionObject = new object();
- public ObservableCollection<LoggingEventModel> LogEventModels { get; set; } = new ObservableCollection<LoggingEventModel>();
- public ObservableCollection<LoggingEventModel> LogProductionModels { get; set; } = new ObservableCollection<LoggingEventModel>();
- public ObservableCollection<LoggingEventModel> LogParameterModels { get; set; } = new ObservableCollection<LoggingEventModel>();
- public ObservableCollection<LoggingEventModel> LogProcessModels { get; set; } = new ObservableCollection<LoggingEventModel>();
- public ObservableCollection<LoggingEventModel> LogActionModels { get; set; } = new ObservableCollection<LoggingEventModel>();
- public static LogDataService Instance()
- {
- if (instance == null) instance = new LogDataService();
- return instance;
- }
- private LogDataService()
- {
- BindingOperations.EnableCollectionSynchronization(LogEventModels, lockEventObject);
- BindingOperations.EnableCollectionSynchronization(LogProductionModels, lockProductionObject);
- BindingOperations.EnableCollectionSynchronization(LogParameterModels, lockParameterObject);
- BindingOperations.EnableCollectionSynchronization(LogProcessModels, lockProcessObject);
- BindingOperations.EnableCollectionSynchronization(LogActionModels, lockActionObject);
- }
- }
- }
|