private void ResetClipboard() { ClipboardContent = null; ContextClipboardName.Text = "Empty clipboard"; ContextClipboardMove.IsEnabled = false; ContextClipboardCopy.IsEnabled = false; CommandClipBoard.Foreground = new SolidColorBrush(Colors.Black); }
private async void Context_Rename(object sender, RoutedEventArgs e) { Models.File File = (Models.File)Files.SelectedItem; if (File != null) { OneInputDialog dialog = new OneInputDialog(File, Server); await dialog.ShowAsync(); Browse(); } }
private void Context_To_ClipBoard(object sender, RoutedEventArgs e) { System.Diagnostics.Debug.WriteLine("Context clipboard "); ClipboardContent = (Models.File)Files.SelectedItem; Color currentAccentColorHex = (Color)Application.Current.Resources["SystemAccentColor"]; SolidColorBrush foreground = new SolidColorBrush(currentAccentColorHex); CommandClipBoard.Foreground = foreground; System.Diagnostics.Debug.WriteLine("Clipboard content:" + ClipboardContent.Label); ContextClipboardName.Text = ClipboardContent.Label; ContextClipboardMove.IsEnabled = true; ContextClipboardCopy.IsEnabled = true; }
public OneInputDialog(Models.File FileParam, Models.Server Server) { this.InitializeComponent(); API = new Pydio.API(Server); this.File = FileParam; this.type = TYPE_RENAME; this.Title = "Rename " + FileParam.Label; Input.PlaceholderText = "New file name"; Input.Text = FileParam.Label; Input.SelectionStart = 0; Input.SelectionLength = File.Label.Split('.')[0].Length; }
private async void Context_Delete(object sender, RoutedEventArgs e) { Models.File File = (Models.File)Files.SelectedItem; var dialog = new Windows.UI.Popups.MessageDialog("Delete " + File.Label + " ?"); dialog.Commands.Add(new Windows.UI.Popups.UICommand("Yes") { Id = 0 }); dialog.Commands.Add(new Windows.UI.Popups.UICommand("No") { Id = 1 }); dialog.DefaultCommandIndex = 0; dialog.CancelCommandIndex = 1; var result = await dialog.ShowAsync(); System.Diagnostics.Debug.WriteLine("result:" + result.Id.ToString()); if (result.Id.ToString().Equals("0")) { bool ApiResult = await API.Delete(WorkSpace, File.Path); if (ApiResult) { Browse(); } else { var okDialog = new MessageDialog("An error occured while deleting the file."); await okDialog.ShowAsync(); } } }