[amd64/tramp] hide interpreter specific trampoline behind ifdef
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / View / CanExpandCollapseAllConverter.cs
1 //------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation.  All rights reserved.
3 //------------------------------------------------------------
4
5 namespace System.Activities.Presentation.View
6 {
7     using System.Globalization;
8     using System.Windows.Data;
9     using System.Windows;
10
11     sealed class CanExpandCollapseAllConverter : IValueConverter
12     {
13         public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
14         {
15             if (value == null || value == DependencyProperty.UnsetValue)
16             {
17                 return false;
18             }
19
20             ActivityDesignerOptionsAttribute attr = WorkflowViewService.GetAttribute<ActivityDesignerOptionsAttribute>(value.GetType());
21             return attr == null || !attr.AlwaysCollapseChildren;
22         }
23
24         public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
25         {
26             throw FxTrace.Exception.AsError(new NotSupportedException());
27         }
28     }
29 }