예제 #1
0
        public void saveMarked(chapterInfo c)
        {
            string     key = c.path;
            chapterRec rec = findRec(key);

            if (rec != null)
            {
                rec.marked = string.Join(";", c.markedIndexs);
                updateMarked(rec);
            }
            else
            {
                var newrec = new chapterRec()
                {
                    key    = c.path,
                    marked = string.Join(";", c.markedIndexs)
                };
                addMarked(newrec);

                m_cache.Add(key, newrec);
                m_dict.Add(key, newrec);
            }
        }
예제 #2
0
        public void getMarked(chapterInfo c)
        {
            c.markedIndexs.Clear();
            string     key = c.path;
            chapterRec rec = findRec(key);

            if (rec == null)
            {
                return;
            }

            var arr = rec.marked.Split(new char[] { ';' },
                                       StringSplitOptions.RemoveEmptyEntries);

            foreach (var i in arr)
            {
                int idx;
                if (int.TryParse(i, out idx))
                {
                    c.markedIndexs.Add(idx);
                }
            }
        }