[reflection] Coop handles icalls in System.Reflection and System.RuntimeTypeHandle...
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / TextFormattingConverter.cs
1 //------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation.  All rights reserved.
3 //------------------------------------------------------------
4
5 namespace System.Activities.Presentation
6 {
7     using System.Diagnostics;
8     using System.Globalization;
9     using System.Windows;
10     using System.Windows.Data;
11     using System.Activities.Presentation.Model;
12
13     //Formats text strings
14     internal sealed class TextFormattingConverter : IValueConverter
15     {
16         public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
17         {
18             if (parameter is string)
19             {
20                 return string.Format(culture, parameter as string, value);
21             }
22             else
23             {
24                 return value.ToString();
25             }
26         }
27
28         public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
29         {
30             throw FxTrace.Exception.AsError(new NotSupportedException());
31         }
32     }
33 }