コード例 #1
0
        private void RenameButton_Click(object sender, RoutedEventArgs e)
        {
            foreach (var path in RenameList)
            {
                FileAttributes attr = File.GetAttributes(path.Key);

                if (attr.HasFlag(FileAttributes.Directory))
                {
                    continue;
                }
                else
                {
                    File.Move(path.Key, path.Value);
                }
            }

            foreach (var path in RenameList)
            {
                if (path.Key == path.Value)
                {
                    continue;
                }

                if (Directory.Exists(path.Key) || File.Exists(path.Key))
                {
                    FileAttributes attr = File.GetAttributes(path.Key);

                    if (attr.HasFlag(FileAttributes.Directory))
                    {
                        Directory.Move(path.Key, path.Value);
                    }
                }
            }

            PreviewFilenames.Clear();
            PreviewFilenames.Add("Done");
        }
コード例 #2
0
 private void PrepareAnalysis()
 {
     RenameList.Clear();
     PreviewFilenames.Clear();
 }