Beispiel #1
0
        private void RenameNote(object sender, RoutedEventArgs e)
        {
            var popup = new FormWindow
            {
                WindowStartupLocation = WindowStartupLocation.CenterOwner,
                Owner = this
            };

            popup.ShowDialog();
            string title = popup.TextForm;

            if (popup.Successful && title != "Default")
            {
                File.Move(this.currentFilePath, this.mainPath + "\\" + title + ".txt");
            }
        }
Beispiel #2
0
        private void CreateText(object sender, RoutedEventArgs e)
        {
            var popup = new FormWindow
            {
                WindowStartupLocation = WindowStartupLocation.CenterOwner,
                Owner = this
            };

            popup.ShowDialog();
            string title = popup.TextForm;

            if (popup.Successful && title != "Default")
            {
                string path = this.mainPath + "\\" + title + ".txt";
                File.WriteAllText(path, "");
                this.OpenNotepad(path);
            }
        }