Exemple #1
0
        public virtual IStorageLocation GetLocation(IMediaId id)
        {
            string            key       = KeyProvider.GetStorageKey(id);
            IStorageContainer container = GetContainer(KeyProvider.GetContainerName(key));
            var location = container.GetLocation(KeyProvider.GetLocationName(key), id);


            return(location);
        }
Exemple #2
0
        public IEnumerable <IStorageLocation> EnumerateLocation(IMediaId id)
        {
            string key           = KeyProvider.GetStorageKey(id);
            string containerName = KeyProvider.GetContainerName(key);


            foreach (IStorageContainer container in GetContainers(containerName))
            {
                foreach (IStorageLocation location in container.GetLocations(KeyProvider.GetLocationName(key)))
                {
                    yield return(location);
                }
            }
        }
Exemple #3
0
        public bool Exists(IMediaId id)
        {
            string            key           = KeyProvider.GetStorageKey(id);
            string            containerName = KeyProvider.GetContainerName(key);
            IStorageContainer container;


            if (ContainerExists(containerName))
            {
                container = GetContainer(containerName);

                return(container.LocationExists(KeyProvider.GetLocationName(key)));
            }

            return(false);
        }
Exemple #4
0
        public void DeleteLocations(IMediaId id)
        {
            string key           = KeyProvider.GetStorageKey(id);
            string containerName = KeyProvider.GetContainerName(key);


            if (ContainerExists(key))
            {
                var container = GetContainer(key);

                container.Delete( );
            }
            else
            {
                var location = GetLocation(id);

                location.Delete( );
            }
        }