1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 //----------------------------------------------------------------
5 namespace System.ServiceModel.Activities.Presentation
8 using System.Activities.Core.Presentation;
9 using System.Activities.Presentation.Model;
10 using System.Globalization;
11 using System.Windows.Data;
13 sealed class ContentButtonTitleConverter : IValueConverter
15 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
17 object content = value;
18 if (content != null && content is ModelItem)
20 content = ((ModelItem)content).GetCurrentValue();
24 return SR.DefineContent;
28 //string contentTypeName = content.GetType().Name;
29 if (content is ReceiveMessageContent || content is SendMessageContent)
31 return SR.ViewMessageContent;
33 else if (content is ReceiveParametersContent || content is SendParametersContent)
35 return SR.ViewParameterContent;
39 Fx.Assert(false, "Content must be of either ReceiveMessageContent, ReceiveParametersContent, SendMessageContent or SendParametersContent.");
45 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
47 throw FxTrace.Exception.AsError(new NotSupportedException());