b3dc23e5906552206099296b985086363b0a606b
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / Converters / VBIdentifierTrimConverter.cs
1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation.  All rights reserved.
3 //----------------------------------------------------------------
4
5 namespace System.Activities.Presentation.Converters
6 {
7     using System.Windows.Data;
8
9     class VBIdentifierTrimConverter : IValueConverter
10     {
11         public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
12         {
13             return value;
14         }
15
16         public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
17         {
18             if (targetType == typeof(string) && value is string)
19             {
20                 return ((string)value).Trim();
21             }
22             else
23             {
24                 return value;
25             }
26         }
27     }
28 }