Exemplo n.º 1
0
        /// <summary>
        /// Locks the specified depth.
        /// </summary>
        /// <param name="depth">The depth.</param>
        /// <param name="timeout">The timeout.</param>
        /// <param name="lockInfoEl">The lock info el.</param>
        /// <param name="element">The element.</param>
        /// <returns></returns>
        public override OpaqueLockToken Lock(Mediachase.Net.Wdom.DepthValue depth, string timeout, Mediachase.Net.Wdom.LockInfoElement lockInfoEl, Mediachase.Net.Wdom.WebDavElementInfo element)
        {
            ReplaceLockOwner(lockInfoEl);
            PropertyInfoCollection collection = GetProperties(element);

            return(WebDavLockManager.Lock(this, depth, timeout, lockInfoEl, collection));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the active locks.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <returns></returns>
        public override IEnumerable <ActiveLockElement> GetActiveLocks(WebDavElementInfo element)
        {
            List <ActiveLockElement> retVal     = new List <ActiveLockElement>();
            WebDavDocument           document   = WebDavDocument.CreateDocument();
            PropertyInfoCollection   collection = GetProperties(element);

            //Remove obsolete lock
            WebDavLockManager.RemoveObsoleteLock(this, collection);
            PropertyInfo lockDiscoveryProp = collection[PropertyInfo.LockDiscoveryProperty];

            if (lockDiscoveryProp != null)
            {
                LockDiscoveryPropertyElement lockDiscoveryEl = (LockDiscoveryPropertyElement)
                                                               document.ImportNode((XmlElement)lockDiscoveryProp.Value, true);
                foreach (ActiveLockElement activeLockEl in lockDiscoveryEl.GetActiveLocks())
                {
                    yield return(activeLockEl);
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Refreshes the lock.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <param name="lockToken">The lock token.</param>
        /// <param name="timeout">The timeout.</param>
        public override void RefreshLock(Mediachase.Net.Wdom.WebDavElementInfo element, OpaqueLockToken lockToken, string timeout)
        {
            PropertyInfoCollection collection = GetProperties(element);

            WebDavLockManager.RefreshLock(this, collection, lockToken, timeout);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Unlocks the specified element.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <param name="lockToken">The lock token.</param>
        public override void Unlock(Mediachase.Net.Wdom.WebDavElementInfo element, OpaqueLockToken lockToken)
        {
            PropertyInfoCollection collection = GetProperties(element);

            WebDavLockManager.Unlock(this, collection, lockToken);
        }