/// <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); }
/// <summary> /// Change the current Notebook /// </summary> /// <param name="notebook"></param> public static bool Change(BangumiNotebook notebook) { return(Change(Archive.ToList().FindIndex(cur => cur == notebook))); }