public SyncServiceLogAppender this[long storeLocationID] { get { SyncServiceLogAppender handler = null; _items.TryGetValue(storeLocationID, out handler); string correctfileName = ""; LoggerSimple.WriteMessage("handler found for storelocationid-" + storeLocationID + "-" + (handler != null).ToString()); if (handler == null) { try { handler = new SyncServiceLogAppender(); _items.Add(storeLocationID, handler); handler.LastUsedDateTime = DateTime.Now; } catch (Exception ex) { LoggerSimple.WriteMessage(ex.Message); } finally { //context.Dispose(); //context = null; } } return(handler); } }
public void Add(long storeLocationID, SyncServiceLogAppender dbHandler) { _items.Add(storeLocationID, dbHandler); }