Ejemplo n.º 1
0
        //private void S_content_LoadMultiChapterCompleted(object sender, contentProvider.LoadChapterCompletedEventArgs e)
        //{
        //    browserPath.Text = e.path;
        //}

        private async void testWriteData()
        {
            content c = new content();
            await c.loadData();

            c.m_words.Add(new word("心配(TÂM PHỐI)"));
            await c.saveData();
        }
Ejemplo n.º 2
0
        //txt: words list
        //
        public async Task <int> saveChapter(string text)
        {
            //clear cur content data
            var words = new List <word>();
            var lines = text.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);

            foreach (var line in lines)
            {
                var word = new word(line);
                if (!word.isEmpty)
                {
                    words.Add(word);
                }
            }
            m_content.m_words = words;
            Debug.WriteLine("{0} {1} {2}", this, "saveChapter", words.Count);
            int ret = await m_content.saveData();

            return(ret);
        }