Ejemplo n.º 1
0
        public static Dictionary <string, Fic> GetFics()
        {
            var res = Liter.GetFics();

            return(res);

            // Leaving this code below temporarily

            var sd = XmlOperator.LoadFics();

            return(new Dictionary <string, Fic>(sd));
        }
Ejemplo n.º 2
0
        public static void XmlToLdb()
        {
            SerializableDictionary <string, Fic> fics;
            List <string> lib = new List <string>();
            SerializableDictionary <string, string> libHash;
            SerializableDictionary <string, string> kindleFiles;

            Dictionary <string, Fic>    nDictFics    = new Dictionary <string, Fic>();
            Dictionary <string, string> nDictLibHash = new Dictionary <string, string>();
            Dictionary <string, string> nDictKindle  = new Dictionary <string, string>();

            bool success = false;

            try
            {
                fics      = XmlOperator.LoadFics();
                nDictFics = new Dictionary <string, Fic>(fics);
                success   = true;
            }
            catch (Exception)
            {
            }

            try
            {
                lib = XmlOperator.GetFolders();
            }
            catch (Exception)
            {
            }

            try
            {
                libHash      = XmlOperator.DeserializeFile <SerializableDictionary <string, string> >(Constants.LibHashList);
                nDictLibHash = new Dictionary <string, string>(libHash);
                success      = true;
            }
            catch (Exception)
            {
            }

            try
            {
                kindleFiles = XmlOperator.DeserializeFile <SerializableDictionary <string, string> >(Constants.KindleList);
                nDictKindle = new Dictionary <string, string>(kindleFiles);
                success     = true;
            }
            catch (Exception)
            {
            }

            if (success)
            {
                try
                {
                    Liter.StoreFics(nDictFics);
                }
                catch (Exception)
                {
                }

                try
                {
                    foreach (string fldrpath in lib)
                    {
                        Liter.AddLib(fldrpath);
                    }
                }
                catch (Exception)
                {
                    throw;
                }

                try
                {
                    // LibHash
                    // Not implemented
                }
                catch (Exception)
                {
                }

                try
                {
                    //Kindle
                    Liter.StoreKindleHashes(nDictKindle);
                }
                catch (Exception)
                {
                    throw;
                }
            }
        }
Ejemplo n.º 3
0
 public static Dictionary <string, string> LoadKindle()
 {
     return(Liter.LoadKindleHashes());
 }
Ejemplo n.º 4
0
 public static void StoreKindle(Dictionary <string, string> hashes)
 {
     Liter.StoreKindleHashes(hashes);
 }
Ejemplo n.º 5
0
 internal static void StoreLibHashes(Dictionary <string, string> fileHashes)
 {
     Liter.StoreHashes(fileHashes);
 }
Ejemplo n.º 6
0
 public static void AddLibraryFolder(string folderpath)
 {
     Liter.AddLib(folderpath);
 }
Ejemplo n.º 7
0
 public static List <string> GetLibFolders()
 {
     return(Liter.GetLib());
 }
Ejemplo n.º 8
0
 public static void StoreFics(Dictionary <string, Fic> fics)
 {
     Liter.StoreFics(fics);
     //SerializableDictionary<string, Fic> sd = new SerializableDictionary<string, Fic>(fics);
     //XmlOperator.StoreWorks(sd);
 }