Exemple #1
0
        /// <summary>
        /// The beta delta function, gets updates for a given folder
        /// </summary>
        /// <param name="cursor">Cursor returned by prvious call</param>
        /// <param name="success">Success Callback</param>
        /// <param name="failure">Failure Callback</param>
        public void GetDeltaAsync(string cursor, Action<DeltaPage> success, Action<DropboxException> failure)
        {
            var request = _requestHelper.CreateDeltaRequest(cursor);
            ExecuteAsync<DeltaPageInternal>(ApiType.Base, request,
                deltaResponse =>
                {
                    var deltaPage = new DeltaPage
                    {
                        Cursor = deltaResponse.Cursor,
                        Has_More = deltaResponse.Has_More,
                        Reset = deltaResponse.Reset,
                        Entries = new List<DeltaEntry>()
                    };

                    foreach (var stringList in deltaResponse.Entries)
                    {
                        deltaPage.Entries.Add(StringListToDelta(stringList));
                    }

                    success (deltaPage);
                },

                failure);
        }
Exemple #2
0
        /// <summary>
        /// Gets the deltas for a user's folders and files.
        /// </summary>
        /// <param name="cursor">The value returned from the prior call to GetDelta or an empty string</param>
        /// <returns></returns>
        public DeltaPage GetDelta(string cursor)
        {
            var request = _requestHelper.CreateDeltaRequest(cursor);

            var deltaResponse =  Execute<DeltaPageInternal>(ApiType.Base, request);

            var deltaPage = new DeltaPage
                                {
                                    Cursor = deltaResponse.Cursor,
                                    Has_More = deltaResponse.Has_More,
                                    Reset = deltaResponse.Reset,
                                    Entries = new List<DeltaEntry>()
                                };

            foreach (var stringList in deltaResponse.Entries)
            {
                deltaPage.Entries.Add(StringListToDeltaEntry(stringList));
            }

            return deltaPage;
        }
Exemple #3
0
        /// <summary>
        /// Gets the deltas for a user's folders and files.
        /// </summary>
        /// <param name="cursor">The value returned from the prior call to GetDelta or an empty string</param>
        /// <param name="pathPrefix">If present, this parameter filters the response to only include entries at or under the specified path</param>
        /// <param name="locale">If present the metadata returned will have its size field translated based on the given locale</param>
        /// <param name="includeMediaInfo">If true, each file will include a photo_info dictionary for photos and a video_info dictionary for videos with additional media info. When include_media_info is specified, files will only appear in delta responses when the media info is ready. If you use the include_media_info parameter, you must continue to pass the same value on subsequent calls using the returned cursor.</param>
        /// <returns></returns>
        public DeltaPage GetDelta(string cursor, string pathPrefix, string locale, bool includeMediaInfo)
        {
            if (!pathPrefix.StartsWith("/")) pathPrefix = "/" + pathPrefix;

            var request = _requestHelper.CreateDeltaRequest(cursor, pathPrefix, locale, includeMediaInfo);

            var deltaResponse =  Execute<DeltaPageInternal>(ApiType.Base, request);

            var deltaPage = new DeltaPage
                                {
                                    Cursor = deltaResponse.Cursor,
                                    Has_More = deltaResponse.Has_More,
                                    Reset = deltaResponse.Reset,
                                    Entries = new List<DeltaEntry>()
                                };

            foreach (var stringList in deltaResponse.Entries)
            {
                deltaPage.Entries.Add(StringListToDeltaEntry(stringList));
            }

            return deltaPage;
        }