예제 #1
0
        public void Record(int bookId, int tocID, NavigationType type = NavigationType.TOCDocument, int pageNum = 0, object tag = null)
        {
            NavigationRecord record = new NavigationRecord
            {
                BookId  = bookId,
                TOCId   = tocID,
                PageNum = pageNum,
                Type    = type,
                Tag     = tag
            };

            if (CurrenRecordIndex == HistoryRecords.Count - 1)
            {
                CurrenRecordIndex++;
                HistoryRecords.Add(record);
            }
            else if (CurrenRecordIndex < HistoryRecords.Count - 1)
            {
                CurrenRecordIndex++;
                HistoryRecords.RemoveRange(CurrenRecordIndex, HistoryRecords.Count - CurrenRecordIndex);
                HistoryRecords.Add(record);
            }
            BackWard = CurrenRecordIndex > 0 ? true : false;
            ForWard  = false;
        }
예제 #2
0
 public void Record(string words)
 {
     if (CurrenRecordIndex == HistoryRecords.Count - 1)
     {
         CurrenRecordIndex++;
         HistoryRecords.Add(words);
     }
     else if (CurrenRecordIndex < HistoryRecords.Count - 1)
     {
         CurrenRecordIndex++;
         HistoryRecords.RemoveRange(CurrenRecordIndex, HistoryRecords.Count - CurrenRecordIndex);
         HistoryRecords.Add(words);
     }
     IsCanBackWard = CurrenRecordIndex > 0 ? true : false;
     IsCanForWard  = false;
 }