public static void SavePages(String bookID, List <Page> list)
 {
     if (!String.IsNullOrEmpty(URL.ServerURL))
     {
         PersistantObjectsStorage.Add(mainKey + URL.ServerURL + bookKey + bookID + chapterKey + pageKey, list);
     }
 }
        public static void SaveBooks(List <Book> list)
        {
            if (!String.IsNullOrEmpty(URL.ServerURL))
            {
                if (list != null)
                {
                    List <Book> bookList = GetBooks();
                    if (bookList != null)
                    {
                        foreach (Book b1 in list)
                        {
                            foreach (Book b2 in bookList)
                            {
                                if (b1.ID == b2.ID)
                                {
                                    b1.Viewed = b2.Viewed;
                                    break;
                                }
                            }
                        }
                    }

                    PersistantObjectsStorage.Add(mainKey + URL.ServerURL + bookKey, list);
                }
            }
        }
        private void SaveTable(String tableId)
        {
            // NOTE: This method abstracts away just how and where we store the table.
            Dictionary <String, T> cachedTable = GetCachedTable(tableId);

            if (cachedTable != null)
            {
                String key = BuildTableKey(tableId);
                PersistantObjectsStorage.Add(key, cachedTable);
            }
        }
        public static List <Book> GetBooks()
        {
            if (!String.IsNullOrEmpty(URL.ServerURL))
            {
                object record = PersistantObjectsStorage.GetValue(mainKey + URL.ServerURL + bookKey);
                if (record != null)
                {
                    return((List <Book>)record);
                }
            }

            return(null);
        }
        public static bool HasPages(String bookID)
        {
            if (!String.IsNullOrEmpty(URL.ServerURL))
            {
                object record = PersistantObjectsStorage.GetValue(mainKey + URL.ServerURL + bookKey + bookID + chapterKey + pageKey);
                if (record != null)
                {
                    return(true);
                }
            }

            return(false);
        }
        public static List <Page> GetPages(String bookID)
        {
            if (!String.IsNullOrEmpty(URL.ServerURL))
            {
                object record = PersistantObjectsStorage.GetValue(mainKey + URL.ServerURL + bookKey + bookID + chapterKey + pageKey);
                if (record != null)
                {
                    return((List <Page>)record);
                }
            }

            return(null);
        }
        private Dictionary <String, T> LoadTable(String tableId)
        {
            // NOTE: This method abstracts away just how and where we store the table.

            Dictionary <String, T> table = null;

            String key      = BuildTableKey(tableId);
            object valueRaw = PersistantObjectsStorage.GetValue(key);

            if (valueRaw == null)
            {
                table = new Dictionary <String, T>();
            }
            else
            {
                table = (Dictionary <String, T>)valueRaw;
            }

            return(table);
        }