Merge pull request #2955 from ludovic-henry/mono_msec_ticks-overflow
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / Base / Core / Internal / PropertyEditing / FromExpression / Framework / Data / AppendSuffixConverter.cs
1 // -------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All Rights Reserved.
3 // -------------------------------------------------------------------
4 //From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Data
5 namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Data
6 {
7     using System;
8     using System.ComponentModel;
9     using System.Diagnostics;
10     using System.Globalization;
11     using System.Reflection;
12     using System.Windows;
13     using System.Windows.Data;
14     using System.Diagnostics.CodeAnalysis;
15     using System.Runtime;
16
17     // <summary>
18     // (object-to-string) Takes an object and returns a new string that is the object's ToString()
19     // with the value of the suffix property appended to it.
20     // </summary>
21
22     [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
23     internal class AppendSuffixConverter : IValueConverter
24     {
25         // Private Fields
26         private string suffix;
27
28         // Public Properties
29         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
30         public string Suffix
31         {
32             get
33             {
34                 return this.suffix;
35             }
36             set
37             {
38                 this.suffix = value;
39             }
40         }
41
42         // IValueConverter Implementation
43         public object ConvertBack(object o, Type targetType, object value, CultureInfo culture)
44         {
45             Fx.Assert(false, "AppendSuffixConverter do not support inverse transform.");
46             return null;
47         }
48
49         public object Convert(object o, Type targetType, object parameter, CultureInfo culture)
50         {
51             return o.ToString() + this.Suffix;
52         }
53     }
54
55 }