From a0e25846735104f09a18647220db59804977e73a Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 8 Apr 2018 17:48:58 +0300 Subject: Fixed issue with "Application Started" event. Fixed issue with segment indexing after emb import. --- .../EventLogging/DefaultEventLogger.cs | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs index 91aa049e9..f3ae1002b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs @@ -78,21 +78,28 @@ namespace Tango.MachineStudio.Common.EventLogging { if (!_isInitialized) { - _db = ObservablesContext.CreateDefault(); - _db.Configuration.LazyLoadingEnabled = false; + try + { + _db = ObservablesContext.CreateDefault(); + _db.Configuration.LazyLoadingEnabled = false; - _db.ActionTypes.ToList(); - _db.EventTypesActions.ToList(); - _db.EventTypesCategories.ToList(); - _db.EventTypesGroups.ToList(); - _db.EventTypes.ToList(); + _db.ActionTypes.ToList(); + _db.EventTypesActions.ToList(); + _db.EventTypesCategories.ToList(); + _db.EventTypesGroups.ToList(); + _db.EventTypes.ToList(); - foreach (var type in _db.EventTypes) + foreach (var type in _db.EventTypes) + { + _eventTypesGuids.Add((EventTypes)type.Code, type); + } + + _isInitialized = true; + } + catch { - _eventTypesGuids.Add((EventTypes)type.Code, type); + _isInitialized = false; } - - _isInitialized = true; } } -- cgit v1.3.1