public override void RefreshResource(IStorageProviderSession session, ICloudFileSystemEntry resource)
        {
            //Request resource by ID and then update properties from requested
            var current = RequestResource(session, resource.Id, null);

            SkyDriveHelpers.CopyProperties(current, resource);

            if (resource is ICloudDirectoryEntry)
            {
                RefreshDirectoryContent(session, resource as ICloudDirectoryEntry);
            }
        }
Exemplo n.º 2
0
        public override void RefreshResource(IStorageProviderSession session, ICloudFileSystemEntry resource)
        {
            //not refresh if resource was requested recently
            var timestamp     = resource.GetPropertyValue(SkyDriveConstants.TimestampKey);
            var refreshNeeded = DateTime.Parse(timestamp, CultureInfo.InvariantCulture) + TimeSpan.FromSeconds(5) < DateTime.UtcNow;

            if (refreshNeeded)
            {
                //Request resource by ID and then update properties from requested
                var current = RequestResource(session, resource.GetPropertyValue(SkyDriveConstants.InnerIDKey), null);
                SkyDriveHelpers.CopyProperties(current, resource);
            }

            var directory = resource as ICloudDirectoryEntry;

            if (directory != null && !refreshNeeded && directory.HasChildrens == nChildState.HasNotEvaluated)
            {
                RefreshDirectoryContent(session, directory);
            }
        }