Esempio n. 1
0
        protected override ItemInfo GetItem(ListInfo list, string path)
        {
            var fullPath = PathUtility.JoinPath(list.Path, path);

            return((ItemInfo)Cache.GetObjectOrDefault(fullPath) ??
                   GetItemDirectly(list, path));
        }
Esempio n. 2
0
        protected override bool HasItem(ListInfo list, string path)
        {
            if (path.EndsWith("/*"))
            {
                var parent = PathUtility.JoinPath(list.Path, PathUtility.GetParentPath(path));
                if (parent.IsEmpty())
                {
                    return(list.HasChildren());
                }
            }
            var fullPath = PathUtility.JoinPath(list.Path, path);

            if (Cache.GetObjectOrDefault(fullPath) == null)
            {
                try {
                    var container = GetItemDirectly(list, path) as ContainerInfo;
                    if (container == null)
                    {
                        return(false);
                    }
                    return(container.HasChildren());
                } catch {
                    return(false);
                }
            }
            return(true);
        }
Esempio n. 3
0
        protected override WebFolderInfo InferWebFolder(WebInfo web, string name)
        {
            var path = PathUtility.JoinPath(web.Path, name);

            return((WebFolderInfo)Cache.GetObjectOrDefault(path) ??
                   InferWebFolderDirectly(web, name));
        }
Esempio n. 4
0
        // Implementation of the NavigatingConnector interface support from the parent class.
        // They look for their result first to the cache because they can be called multiple
        // times by the code in the connector, the drive provider or the originating cmdlet.

        protected override WebInfo GetWeb(string path)
        {
            return((WebInfo)Cache.GetObjectOrDefault(path) ?? GetWebDirectly(path));
        }
Esempio n. 5
0
        // Reimplementation of the internal object access to utilize caching.

        protected override Info ExistsObjectInternal(string path)
        {
            return(Cache.GetObjectOrDefault(path) ?? base.ExistsObjectInternal(path));
        }