Mono exception to SocketException
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Core.Presentation / System / Activities / Core / Presentation / DynamicActivityPropertyToTooltipConverter.cs
1 //----------------------------------------------------------------
2 // <copyright company="Microsoft Corporation">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //----------------------------------------------------------------
6
7 namespace System.Activities.Core.Presentation
8 {
9     using System.Activities.Presentation;
10     using System.Globalization;
11     using System.Windows.Data;
12     using Microsoft.Activities.Presentation;
13
14     internal sealed class DynamicActivityPropertyToTooltipConverter : IValueConverter
15     {
16         public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
17         {
18             DynamicActivityProperty property = value as DynamicActivityProperty;
19
20             if (property == null)
21             {
22                 return null;
23             }
24
25             if (property.Type == null)
26             {
27                 return string.Format(CultureInfo.CurrentUICulture, SR.PropertyReferenceNotResolved, property.Name);
28             }
29             else
30             {
31                 return TypeNameHelper.GetDisplayName(property.Type, false);
32             }
33         }
34
35         public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
36         {
37             throw FxTrace.Exception.AsError(new NotImplementedException());
38         }
39     }
40 }