Example #1
0
        public void Update()
        {
            Preferences.Load();
            Notes = NoteView.CreateFromDirectory(Preferences.Folder);

            GenerateActions();
            GenerateContent();
        }
Example #2
0
        public void Update()
        {
            Preferences.Load();
            Notes = NoteView.CreateFromDirectory(Preferences.Folder);

            GenerateActions();
            GenerateContent();
        }
Example #3
0
        public void Update()
        {
            Preferences.Load();
            Notes = NoteView.CreateFromDirectory(Preferences.Folder);

            GenerateMenu();
            GenerateToolBar();

            GenerateContent();
        }
Example #4
0
        public void Update()
        {
            Preferences.Load();
            Notes = NoteView.CreateFromDirectory(Preferences.Folder);

            GenerateMenu();
            GenerateToolBar();

            GenerateContent();
        }
Example #5
0
        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);
        }
Example #6
0
        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;
        }