internal static void Rename(Window owner, SmartItem item, bool isLocal) { RenameWindow RW = new RenameWindow(owner, item.ItemName, item.Extension, isLocal); if ((bool)RW.ShowDialog()) { if (isLocal) { string newFullname = LocalHelper.CurrentPath + @"\" + RW.newName; if (item.IsFile) { FileHelper.Rename(item.FullName, newFullname); } else { DirectoryHelper.Rename(item.FullName, newFullname); } } else { ClientHelper.RenameAsync(item, RW.newName); } } }
private void MenuItemServerRename_Click(object sender, RoutedEventArgs e) { SmartItem item = ServerList.SelectedItem(); if (item == null) { return; } RenameWindow.Rename(this, item, false); }
private void MenuItemLocalRename_Click(object sender, RoutedEventArgs e) { SmartItem item = LocalList.SelectedItem(); if (item == null) { return; } RenameWindow.Rename(this, item, true); }