Example #1
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;
                }
            }
        }
Example #2
0
 public static void StoreFics(Dictionary <string, Fic> fics)
 {
     Liter.StoreFics(fics);
     //SerializableDictionary<string, Fic> sd = new SerializableDictionary<string, Fic>(fics);
     //XmlOperator.StoreWorks(sd);
 }