Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Windows.Data;
|
---|
6 |
|
---|
7 | namespace Microsoft.Research.DynamicDataDisplay.Converters
|
---|
8 | {
|
---|
9 | public abstract class ThreeValuesMultiConverter<T1, T2, T3> : IMultiValueConverter
|
---|
10 | {
|
---|
11 | #region IMultiValueConverter Members
|
---|
12 |
|
---|
13 | public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
---|
14 | {
|
---|
15 | if (values != null && values.Length == 3)
|
---|
16 | {
|
---|
17 | if (values[0] is T1 && values[1] is T2 && values[2] is T3)
|
---|
18 | {
|
---|
19 | T1 param1 = (T1)values[0];
|
---|
20 | T2 param2 = (T2)values[1];
|
---|
21 | T3 param3 = (T3)values[2];
|
---|
22 |
|
---|
23 | var result = ConvertCore(param1, param2, param3, targetType, parameter, culture);
|
---|
24 | return result;
|
---|
25 | }
|
---|
26 | }
|
---|
27 | return null;
|
---|
28 | }
|
---|
29 |
|
---|
30 | protected abstract object ConvertCore(T1 value1, T2 value2, T3 value3, Type targetType, object parameter, System.Globalization.CultureInfo culture);
|
---|
31 |
|
---|
32 | public virtual object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
|
---|
33 | {
|
---|
34 | throw new NotSupportedException();
|
---|
35 | }
|
---|
36 |
|
---|
37 | #endregion
|
---|
38 | }
|
---|
39 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.