示例#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));
 }