Пример #1
0
        private ReportCellProperty GetCellProperty(AttributeBase attribute)
        {
            ReportCellProperty property = null;

            switch (attribute)
            {
            case AlignmentAttribute alignmentAttribute:
                property = new AlignmentProperty(alignmentAttribute.Alignment);
                break;

            case BoldAttribute _:
                property = new BoldProperty();
                break;

            case ColorAttribute colorAttribute:
                property = new ColorProperty(colorAttribute.FontColor, colorAttribute.BackgroundColor);
                break;

            case DateTimeFormatAttribute dateTimeFormatAttribute:
                property = new DateTimeFormatProperty(dateTimeFormatAttribute.Format);
                break;

            case DecimalPrecisionAttribute decimalPrecisionAttribute:
                property = new DecimalPrecisionProperty(decimalPrecisionAttribute.Precision);
                break;

            case MaxLengthAttribute maxLengthAttribute:
                property = new MaxLengthProperty(maxLengthAttribute.MaxLength);
                break;

            case PercentFormatAttribute percentFormatAttribute:
                property = new PercentFormatProperty(percentFormatAttribute.Precision)
                {
                    PostfixText = percentFormatAttribute.PostfixText,
                };
                break;
            }

            return(property);
        }
Пример #2
0
 set => SetValue(MaxLengthProperty, value);
Пример #3
0
 set => this.SetValue(MaxLengthProperty, value);
Пример #4
0
 set => base.SetValue(MaxLengthProperty, value);
Пример #5
0
 static ByteUpDown()
 {
     UpdateMetadata(typeof(ByteUpDown), ( byte )1, byte.MinValue, byte.MaxValue);
     MaxLengthProperty.OverrideMetadata(typeof(ByteUpDown), new FrameworkPropertyMetadata(3));
 }