private void CreateFolder(object sender, RoutedEventArgs e) { TextEnterWindow nameWin = new TextEnterWindow() { WindowStartupLocation = WindowStartupLocation.CenterScreen }; nameWin.okBtn.Click += (s, _) => { string newName = nameWin.nameBox.Text.Trim(); if (newName != "") { try { status = client.CreateFolder(newName); Refresh(); } catch (Exception ex) { ShowException(ex.Message); } } }; nameWin.ShowDialog(); }
private void Rename(object sender, RoutedEventArgs e) { TextEnterWindow nameWin = new TextEnterWindow() { Owner = this, WindowStartupLocation = WindowStartupLocation.CenterOwner }; nameWin.okBtn.Click += (s, _) => { string newName = nameWin.nameBox.Text.Trim(); if (newName != "") { try { status = client.Rename((filesList.SelectedItem as EntryControl).FileName.Text, newName); Refresh(); } catch (Exception ex) { ShowException(ex.Message); } } }; nameWin.ShowDialog(); }