Inheritance: Caliburn.Micro.PropertyChangedBase
コード例 #1
0
 public void Remove(Notebook nb)
 {
     
     if (Plugin.Notebooks.Contains(nb))
     {
         Plugin.Notebooks.Remove(nb);
     }
 }
コード例 #2
0
        public void AddNotebook()
        {
            if (Plugin.Notebooks.Any(k => k.Name.ToLower() == NewName.ToLower()))
            {
                AppState.TriggerNotification("Could not create notebook. This name is already in use");
                return;
            }
            var nb = new Notebook() {Name = NewName};
            var ff = Plugin.ScreenshotFolder;
            if (ff.Any())
            {
                var f = Path.Combine(ff.First(), NewName);
                if (!Directory.Exists(f)) Directory.CreateDirectory(f);
                nb.Folder = f;
                nb.Available = Directory.Exists(f);
                
                Plugin.Notebooks.Add(nb);
                Plugin.Notebooks.Save();

                Plugin.Notebooks.ActiveNotebook = nb;
            }
        }