Fix XMM scanning on Mac x86.
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / Base / Core / Internal / PropertyEditing / Editors / ValueToToolTipConverter.cs
1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation.  All rights reserved.
3 //----------------------------------------------------------------
4 namespace System.Activities.Presentation.Internal.PropertyEditing.Editors 
5 {
6     using System;
7     using System.Diagnostics;
8     using System.Diagnostics.CodeAnalysis;
9     using System.Globalization;
10     using System.Windows.Data;
11     using System.Runtime;
12     using System.Activities.Presentation;
13
14     // <summary>
15     // A converter that takes a value of a property and a boolean indicating whether it
16     // is being edited and returns a string to use for the editor tool tip.
17     // This class gets instantiated from XAML.
18     // </summary>
19     [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
20     internal class ValueToToolTipConverter : IMultiValueConverter 
21     {
22         public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) {
23             Fx.Assert(values != null && values.Length == 2, "Invalid values passed into ValueToToolTipConverter");
24
25             bool isEditing = (bool)values[1];
26             string value = isEditing ? null : EditorUtilities.GetDisplayName(values[0]);
27
28             return string.IsNullOrEmpty(value) ? null : value;
29         }
30
31         public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) {
32             throw FxTrace.Exception.AsError(new NotImplementedException());
33         }
34     }
35 }