source: trunk/CrypPlugins/PKCS1/WpfResources/ErrorsToMessageConverter.cs

Last change on this file was 8109, checked in by kopal, 3 years ago
  • removed all unused references from all source code files
File size: 970 bytes
Line 
1using System;
2using System.Collections.ObjectModel;
3using System.Linq;
4using System.Text;
5using System.Windows.Controls;
6using System.Windows.Data;
7
8namespace PKCS1.WpfResources
9{
10    public class ErrorsToMessageConverter : IValueConverter
11    {
12        public object Convert(object value, Type targetType, object parameter,
13          System.Globalization.CultureInfo culture)
14        {
15            var sb = new StringBuilder();
16            var errors = value as ReadOnlyCollection<ValidationError>;
17            if (errors != null)
18            {
19                foreach (var e in errors.Where(e => e.ErrorContent != null))
20                { sb.AppendLine(e.ErrorContent.ToString()); }
21            }
22
23            return sb.ToString();
24        }
25
26        public object ConvertBack(object value, Type targetType, object parameter,
27          System.Globalization.CultureInfo culture)
28        { throw new NotImplementedException(); }
29    }
30}
Note: See TracBrowser for help on using the repository browser.