Example #1
0
 public void Close()
 {
     lock (this.SyncRoot)
     {
         _so.Close();
         _so = null;
     }
 }
        /// <summary>
        /// Creates shared object with given parent scope, name, persistence flag state and store object.
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="name"></param>
        /// <param name="persistent"></param>
        /// <param name="store"></param>
		public SharedObjectScope(IScope parent, string name, bool persistent, IPersistenceStore store):base(parent, SharedObjectService.ScopeType, name, persistent)
		{
            string path = parent.ContextPath;
            if (!path.StartsWith("/"))
                path = "/" + path;
			// Create shared object wrapper around the attributes
            _so = store.Load(name) as SharedObject;
			if(_so == null) 
			{
                _so = new SharedObject(_attributes, name, path, persistent, store);
				store.Save(_so);
			} 
			else 
			{
				_so.Name = name;
				_so.Path = parent.ContextPath;
				_so.Store = store;
			}
		}
Example #3
0
        /// <summary>
        /// Creates shared object with given parent scope, name, persistence flag state and store object.
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="name"></param>
        /// <param name="persistent"></param>
        /// <param name="store"></param>
        public SharedObjectScope(IScope parent, string name, bool persistent, IPersistenceStore store) : base(parent, SharedObjectService.ScopeType, name, persistent)
        {
            string path = parent.ContextPath;

            if (!path.StartsWith("/"))
            {
                path = "/" + path;
            }
            // Create shared object wrapper around the attributes
            _so = store.Load(name) as SharedObject;
            if (_so == null)
            {
                _so = new SharedObject(_attributes, name, path, persistent, store);
                store.Save(_so);
            }
            else
            {
                _so.Name  = name;
                _so.Path  = parent.ContextPath;
                _so.Store = store;
            }
        }
		public void Close()
		{
            lock (this.SyncRoot)
            {
                _so.Close();
                _so = null;
            }
		}