コード例 #1
0
 public bool CanProvideConverter(BinderViewBase view, BinderHint hint)
 {
     return hint == BinderHint.Money || hint == BinderHint.Weight ||
         hint == BinderHint.Length || hint == BinderHint.NaturalNumber ||
         hint == BinderHint.Year || hint == BinderHint.Percentage ||
         hint == BinderHint.MinutesDuration || hint == BinderHint.HoursAndMinutesDuration ||
         hint == BinderHint.MoneyString;
 }
コード例 #2
0
        public ViewConverterBase ProvideConverter(BinderViewBase view, BinderHint hint)
        {
            if (hint == BinderHint.Money)
                return new ConvertConverter(typeof(decimal));

            if (hint == BinderHint.Weight || hint == BinderHint.Length ||
                hint == BinderHint.Percentage || hint == BinderHint.MinutesDuration ||
                hint == BinderHint.HoursAndMinutesDuration)
                return new ConvertConverter(typeof(double));

            if (hint == BinderHint.NaturalNumber || hint == BinderHint.Year)
                return new ConvertConverter(typeof(int));

            if (hint == BinderHint.MoneyString)
                return new FormatConverter("${0:0.00}");

            throw new InvalidOperationException();
        }
コード例 #3
0
ファイル: BindableOr.cs プロジェクト: gregorypilar/interlace
 public void AddBinding(BinderViewBase view, ViewConverterBase converter)
 {
     _binder.AddBinding("Output", view, converter);
 }
コード例 #4
0
ファイル: BindableOr.cs プロジェクト: gregorypilar/interlace
 public void AddBinding(BinderViewBase view)
 {
     _binder.AddBinding("Output", view);
 }