Esempio n. 1
0
        //rename
        public void Rename()
        {
            string directory = Path.GetDirectoryName(path);

            SimpleTextDialog dialog = new SimpleTextDialog();

            dialog.Owner      = TDCGExplorer.MainFormWindow;
            dialog.dialogtext = TextResource.Rename;   //"ファイル名の変更";
            dialog.labeltext  = TextResource.Filename; //"ファイル名";
            dialog.textfield  = Path.GetFileName(path);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                File.Move(path, Path.Combine(directory, dialog.textfield));
                TDCGExplorer.DeleteFileTree(path);
                TDCGExplorer.AddFileTree(Path.Combine(directory, dialog.textfield));
            }
        }