コード例 #1
0
 public static void SavePages(String bookID, List <Page> list)
 {
     if (!String.IsNullOrEmpty(URL.ServerURL))
     {
         PersistantObjectsStorage.Add(mainKey + URL.ServerURL + bookKey + bookID + chapterKey + pageKey, list);
     }
 }
コード例 #2
0
        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);
                }
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }