Ejemplo n.º 1
0
        private static Attribute[] MergeAttributes(DataSchema dataSchema, IColumnCaption columnCaption,
                                                   Attribute[] existingAttributes)
        {
            var overrideAttributes = new Attribute[]
            {
                new DisplayNameAttribute(columnCaption.GetCaption(dataSchema.DataSchemaLocalizer)),
                new ColumnCaptionAttribute(columnCaption)
            };

            return(AttributeCollection.FromExisting(new AttributeCollection(existingAttributes.ToArray()), overrideAttributes)
                   .Cast <Attribute>().ToArray());
        }
Ejemplo n.º 2
0
 public ColumnId(IColumnCaption columnCaption) : this(columnCaption.GetCaption(DataSchemaLocalizer.INVARIANT))
 {
 }
Ejemplo n.º 3
0
        private IColumnCaption FormatChildDisplayName(ColumnDescriptor columnDescriptor, IColumnCaption childDisplayName)
        {
            if (null == columnDescriptor)
            {
                return(childDisplayName);
            }
            var childDisplayNameAttribute =
                columnDescriptor.GetAttributes().OfType <ChildDisplayNameAttribute>().FirstOrDefault();

            if (null != childDisplayNameAttribute)
            {
                childDisplayName = new ColumnCaption(string.Format(childDisplayNameAttribute.InvariantFormat, childDisplayName.GetCaption(DataSchemaLocalizer.INVARIANT)));
            }
            return(FormatChildDisplayName(columnDescriptor.Parent, childDisplayName));
        }
Ejemplo n.º 4
0
 public string GetCaption(DataSchemaLocalizer localizer)
 {
     return(LocalizationHelper.CallWithCulture(localizer.FormatProvider,
                                               () => string.Format(_aggregateOperation._getCaptionFormatStringFunc(),
                                                                   _baseCaption.GetCaption(localizer))));
 }