SaveDetails() public method

Saves the Details information.
public SaveDetails ( ) : void
return void
Esempio n. 1
0
        /// <summary>
        /// Adds the specified entry id to the recently viewed entries list.
        /// </summary>
        /// <param name="entryId">The entry id.</param>
        public static void AddRecent(string entryId)
        {
            var recents = _info.Details.Recents;

            recents.Remove(entryId);
            recents.Insert(0, entryId);

            if (recents.Count == 10)
            {
                recents.RemoveAt(9);
            }

            _info.SaveDetails();
        }
Esempio n. 2
0
        private static void Report(DatabaseInfo info,
            SyncCompleteInfo result, ReportUpdateResult report)
        {
            string msg = null;
            var details = info.Details;

            switch (result.Result)
            {
                case SyncResults.Downloaded:
                    using (var buffer = new MemoryStream(result.Database))
                        info.SetDatabase(buffer, details);
                    break;

                case SyncResults.Uploaded:
                    details.Modified = result.Modified;
                    info.SaveDetails();
                    break;

                case SyncResults.Conflict:
                    details.Url = result.Path;
                    details.Modified = result.Modified;
                    info.SaveDetails();

                    msg = string.Format(
                        Properties.Resources.Conflict,
                        new Uri(result.Path).LocalPath);
                    break;

                case SyncResults.Failed:
                    msg = Properties.Resources
                        .DownloadError;
                    break;
            }

            report(info, result.Result, msg);
        }