示例#1
0
        private void BtnInfo_Click(object sender, RoutedEventArgs e)
        {
            FileSystemImage img  = viewModel.CurrentImage;
            BitmapSource    crop = (BitmapSource)img?.CroppedImage;
            string          text =
                $"Image: {img?.Image?.PixelWidth} x {img?.Image?.PixelHeight}\r\n" +
                $"Crop: {crop?.PixelWidth ?? -1} x {crop?.PixelHeight ?? -1}\r\n" +
                $"Size: {StdUtils.GetFormattedFileSize(img?.File.Length ?? -1)}";

            MessageBox.Show(text);
        }
示例#2
0
        private static bool AskCopy(FileInfo srcFile, string destFileName)
        {
            FileInfo destFile = new FileInfo(destFileName);
            string   message  =
                $"Replace file?\r\nSource: {srcFile.FullName}\r\n" +
                $"Size {StdUtils.GetFormattedFileSize(srcFile.Length)}\r\n" +
                $"Destination: {destFileName}\r\n" +
                $"Size {StdUtils.GetFormattedFileSize(destFile.Length)}";

            return(MessageBox.Show(message, "Replace?", MessageBoxButton.YesNo,
                                   MessageBoxImage.Warning, MessageBoxResult.No) == MessageBoxResult.Yes);
        }
示例#3
0
        private static bool AskDelete(FileInfo file)
        {
            if (file == null)
            {
                return(false);
            }

            string size    = StdUtils.GetFormattedFileSize(file.Length);
            string message = $"Delete?\r\n{file.FullName}\r\nSize: {size}";

            return(MessageBox.Show(message, "Delete?", MessageBoxButton.YesNo,
                                   MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes);
        }