コード例 #1
0
        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);
            }
        }
コード例 #2
0
 public void Add(long storeLocationID, SyncServiceLogAppender dbHandler)
 {
     _items.Add(storeLocationID, dbHandler);
 }