DocumentConfirm.xaml.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using InABox.Wpf;
  2. using System;
  3. using System.Windows;
  4. namespace InABox.DynamicGrid
  5. {
  6. /// <summary>
  7. /// Interaction logic for DocumentConfirm.xaml
  8. /// </summary>
  9. public partial class DocumentConfirm : ThemableWindow
  10. {
  11. public DocumentConfirm()
  12. {
  13. InitializeComponent();
  14. }
  15. public string FileName { get; set; }
  16. public DateTime LocalTimeStamp { get; set; }
  17. public DateTime RemoteTimeStamp { get; set; }
  18. public int LocalSize { get; set; }
  19. public int RemoteSize { get; set; }
  20. public DocumentAction Result { get; set; }
  21. private void Window_Loaded(object sender, RoutedEventArgs e)
  22. {
  23. Header.Content = string.Format("A file named [{0}] already exists on the server!", FileName);
  24. NewTimeStamp.Content = string.Format("{0:dd MMM yy HH:mm:ss}", LocalTimeStamp);
  25. OldTimeStamp.Content = string.Format("{0:dd MMM yy HH:mm:ss}", RemoteTimeStamp);
  26. OldSize.Content = string.Format("{0:n0}", RemoteSize);
  27. NewSize.Content = string.Format("{0:n0}", LocalSize);
  28. Result = DocumentAction.MakeCopy;
  29. }
  30. private void ReplaceButton_Click(object sender, RoutedEventArgs e)
  31. {
  32. Result = DocumentAction.Replace;
  33. DialogResult = true;
  34. Close();
  35. }
  36. private void ExistingButton_Click(object sender, RoutedEventArgs e)
  37. {
  38. Result = DocumentAction.UseExisting;
  39. DialogResult = true;
  40. Close();
  41. }
  42. private void MakeCopyButton_Click(object sender, RoutedEventArgs e)
  43. {
  44. Result = DocumentAction.MakeCopy;
  45. DialogResult = true;
  46. Close();
  47. }
  48. private void CancelButton_Click(object sender, RoutedEventArgs e)
  49. {
  50. DialogResult = false;
  51. Close();
  52. }
  53. }
  54. }