Esempio n. 1
0
            /// <summary>
            /// Remove the selected Notebook
            /// </summary>
            /// <param name="dataContext"></param>
            public static bool Remove(BangumiNotebook notebook)
            {
                int index = Archive.ToList().FindIndex(cur => cur == notebook);

                // Add new notebook if this is the last one
                if (Archive.Count <= 1)
                {
                    Archive.Add(new BangumiNotebook("New Notebook"));
                }

                Archive.RemoveAt(index);
                if (index == ArcIndex)
                {
                    ArcIndex = 0;
                    ResetAll();
                    return(true);
                }
                else if (index < ArcIndex)
                {
                    ArcIndex -= 1;
                }
                return(false);
            }
Esempio n. 2
0
 /// <summary>
 /// Change the current Notebook
 /// </summary>
 /// <param name="notebook"></param>
 public static bool Change(BangumiNotebook notebook)
 {
     return(Change(Archive.ToList().FindIndex(cur => cur == notebook)));
 }