public void Update() { Preferences.Load(); Notes = NoteView.CreateFromDirectory(Preferences.Folder); GenerateActions(); GenerateContent(); }
public void Update() { Preferences.Load(); Notes = NoteView.CreateFromDirectory(Preferences.Folder); GenerateMenu(); GenerateToolBar(); GenerateContent(); }
public static NoteView CreateFromDirectory(string dir) { var result = new NoteView(dir); if (!Directory.Exists(dir)) { return(result); } string[] files = Directory.GetFiles(dir); if (files.Length != 0) { foreach (string file in files) { string name = file.Replace(dir, "").Replace(".txt", ""); string text = File.ReadAllText(file, Encoding.UTF8); result.AddNote(name, text, file); } result.ListBox.SelectedIndex = 0; } return(result); }
public static NoteView CreateFromDirectory(string dir) { var result = new NoteView(dir); if (!Directory.Exists(dir)) return result; string[] files = Directory.GetFiles(dir); if (files.Length != 0) { foreach (string file in files) { string name = file.Replace(dir, "").Replace(".txt", ""); string text = File.ReadAllText(file, Encoding.UTF8); result.AddNote(name, text, file); } result.ListBox.SelectedIndex = 0; } return result; }