Ejemplo n.º 1
0
        public static void SavingSetting()
        {
            string ot = "";

            foreach (var x in setting.data)
            {
                ot += x.Key + "," + x.Value + "\n";
            }
            //var fileService = DependencyService.Get<ISaveAndLoad>();
            SaveAndLoad.SaveText("setting.txt", ot);
        }
Ejemplo n.º 2
0
        //public static SortedDictionary<string, SortedSet<string>> rtp=null;
        public static void DumpAppFile(string fil)
        {
            string s = SaveAndLoad.LoadText(fil);

            SaveAndLoad.SaveText(fil, s);
        }
Ejemplo n.º 3
0
        //public static SortedDictionary<string, SortedSet<string>> rtp=null;
        public static void DumpAppFile(string fil)
        {
            string s = SaveAndLoad.LoadText("..\\bin\\data\\" + fil);

            SaveAndLoad.SaveText(fil, s);
        }
Ejemplo n.º 4
0
        private void Init()
        {
            int data_version = 18;

            //await Voc.InitAsync();

            if (!SaveAndLoad.FileExists("setting.txt"))
            {
                SaveAndLoad.SaveText("setting.txt", "");
            }

            Voc.setting = Voc.GetDoc("setting", false);

            if (!Voc.setting.exists("website"))
            {
                Voc.setting.add("website", "http://joe59491.azurewebsites.net");
            }
            if (!Voc.setting.exists("sound_url"))
            {
                Voc.setting.add("sound_url", "http://dictionary.reference.com/browse/");
            }
            if (!Voc.setting.exists("sound_url2"))
            {
                Voc.setting.add("sound_url2", "http://static.sfdict.com/staticrep/dictaudio");
            }
            if (!Voc.setting.exists("sound_type"))
            {
                Voc.setting.add("sound_type", ".mp3");
            }
            if (!Voc.setting.exists("data_version"))
            {
                Voc.setting.add("data_version", "0");
            }
            Voc.SavingSetting();

            if (!SaveAndLoad.FileExists("favorite.txt"))
            {
                SaveAndLoad.SaveText("favorite.txt", "");
            }
            Voc.favorite = Voc.GetDoc("favorite", false);
            if (!SaveAndLoad.FileExists("words.txt") || int.Parse(Voc.setting["data_version"]) < data_version)
            {
                Voc.DumpAppFile("words.txt");
            }
            if (!SaveAndLoad.FileExists("root.txt") || int.Parse(Voc.setting["data_version"]) < data_version)
            {
                Voc.DumpAppFile("root.txt");
            }
            if (!SaveAndLoad.FileExists("prefix.txt") || int.Parse(Voc.setting["data_version"]) < data_version)
            {
                Voc.DumpAppFile("prefix.txt");
            }
            if (!SaveAndLoad.FileExists("suffix.txt") || int.Parse(Voc.setting["data_version"]) < data_version)
            {
                Voc.DumpAppFile("suffix.txt");
            }
            if (!SaveAndLoad.FileExists("note.txt") || int.Parse(Voc.setting["data_version"]) < data_version)
            {
                Voc.DumpAppFile("note.txt");
            }
            if (int.Parse(Voc.setting["data_version"]) < data_version)
            {
                Voc.setting["data_version"] = data_version.ToString();
            }

            Voc.words = Voc.GetDoc("words", true);
            var tmp = Voc.words.val("apple");

            foreach (var x in Voc.words.data)
            {
                var y = x;
            }

            Voc.root = Voc.GetDoc("root", true);

            Voc.prefix = Voc.GetDoc("prefix", true);

            Voc.suffix = Voc.GetDoc("suffix", true);

            Voc.note = Voc.GetDoc("note", true);
        }