コード例 #1
0
        private void RenameDatabase()
        {
            var originalFileDirectory = Path.GetDirectoryName(originalElement.DatabasePath);
            var originalFileEnding    = Path.GetExtension(originalElement.DatabasePath);
            var newFileName           = string.Format("{0}{1}", NewName, originalFileEnding);
            var newDatabasePath       = Path.Combine(originalFileDirectory, newFileName);

            File.Move(originalElement.DatabasePath, newDatabasePath);
            MainTreeHandler.UpdateDatabase(originalElement.DatabasePath, newDatabasePath);
        }