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

Last change on this file since 1765 was 1743, checked in by schomburg, 11 years ago

Limitation on Kuehn Signature Generation editable by User
beta version of helpfile Gen_Kuehn_Sig_Tab.html

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