Exemple #1
0
        // 包装后的版本
        public void SetObject(string strPath,
                              T obj,
                              string strTimestamp = "")
        {
            if (obj == null)
            {
                SetObjectItem(strPath, null);
                return;
            }
            ObjectItem <T> item = new ObjectItem <T>();

            item.Object    = obj;
            item.Timestamp = strTimestamp;
            SetObjectItem(strPath, item);
        }
Exemple #2
0
 public void SetObjectItem(string strPath,
                           ObjectItem <T> object_item)
 {
     this._lock.EnterWriteLock();
     try
     {
         if (object_item == null)
         {
             this.m_table.Remove(strPath);
             return;
         }
         this.m_table[strPath] = object_item;
     }
     finally
     {
         this._lock.ExitWriteLock();
     }
 }