コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: CloudNStoyan/notes
        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");
            }
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: CloudNStoyan/notes
        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);
            }
        }