Ejemplo n.º 1
0
 public string GetColumnCaption(ColumnCaption columnCaption, ColumnCaptionType columnCaptionType)
 {
     if (columnCaptionType == ColumnCaptionType.invariant)
     {
         return(columnCaption.InvariantCaption);
     }
     return(DataSchemaLocalizer.LookupColumnCaption(columnCaption));
 }
Ejemplo n.º 2
0
 public bool HasEntry(ColumnCaption caption)
 {
     if (!caption.IsLocalizable)
     {
         return true;
     }
     return ColumnCaptionResourceManagers
         .Any(resourceManager => null != resourceManager.GetString(caption.InvariantCaption));
 }
Ejemplo n.º 3
0
 public bool HasEntry(ColumnCaption caption)
 {
     if (!caption.IsLocalizable)
     {
         return(true);
     }
     return(ColumnCaptionResourceManagers
            .Any(resourceManager => null != resourceManager.GetString(caption.InvariantCaption)));
 }
Ejemplo n.º 4
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ (ColumnCaption != null ? ColumnCaption.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DataSchemaLocalizer != null ? DataSchemaLocalizer.GetHashCode() : 0);
         return(hashCode);
     }
 }
Ejemplo n.º 5
0
        public virtual IColumnCaption GetColumnCaption(ColumnDescriptor columnDescriptor)
        {
            DisplayNameAttribute displayNameAttribute =
                columnDescriptor.GetAttributes().OfType <DisplayNameAttribute>().FirstOrDefault();

            if (null != displayNameAttribute)
            {
                return(ColumnCaption.UnlocalizableCaption(displayNameAttribute.DisplayName));
            }
            return(FormatChildDisplayName(columnDescriptor.Parent, GetBaseDisplayName(columnDescriptor)));
        }
Ejemplo n.º 6
0
 public string LookupColumnCaption(ColumnCaption caption)
 {
     foreach (var columnCaptionResourceManager in ColumnCaptionResourceManagers)
     {
         string localizedCaption = columnCaptionResourceManager.GetString(caption.InvariantCaption);
         if (null != localizedCaption)
         {
             return(localizedCaption);
         }
     }
     return(caption.InvariantCaption);
 }
Ejemplo n.º 7
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.º 8
0
 public string LookupColumnCaption(ColumnCaption caption)
 {
     if (!caption.IsLocalizable)
     {
         return caption.InvariantCaption;
     }
     foreach (var columnCaptionResourceManager in ColumnCaptionResourceManagers)
     {
         string localizedCaption = columnCaptionResourceManager.GetString(caption.InvariantCaption);
         if (null != localizedCaption)
         {
             return localizedCaption;
         }
     }
     return caption.InvariantCaption;
 }
Ejemplo n.º 9
0
        public IColumnCaption GetColumnCaption(PivotKey pivotKey)
        {
            IColumnCaption columnCaption;

            if (null != ColumnSpec.Caption)
            {
                columnCaption = ColumnCaption.UnlocalizableCaption(ColumnSpec.Caption);
            }
            else if (null == ColumnDescriptor)
            {
                columnCaption = ColumnCaption.UnlocalizableCaption(PropertyPath.ToString());
            }
            else
            {
                columnCaption = DataSchema.GetColumnCaption(ColumnDescriptor);
            }
            return(QualifyColumnCaption(pivotKey, columnCaption));
        }
Ejemplo n.º 10
0
        public static IColumnCaption MakeCaptionComponent(object part)
        {
            if (part == null)
            {
                return(EMPTY);
            }
            IColumnCaption captionComponent = part as IColumnCaption;

            if (captionComponent != null)
            {
                return(captionComponent);
            }
            var formattable = part as IFormattable;

            if (formattable != null)
            {
                return(new FormattableCaption(formattable));
            }
            return(ColumnCaption.UnlocalizableCaption(part.ToString()));
        }
Ejemplo n.º 11
0
 public string GetLocalizedColumnCaption(ColumnCaption columnCaption)
 {
     return(DataSchemaLocalizer.LookupColumnCaption(columnCaption));
 }
Ejemplo n.º 12
0
 public EditDescription(ColumnCaption columnCaption, object value)
 {
     ColumnCaption = columnCaption;
     Value = value;
 }
Ejemplo n.º 13
0
 public bool HasEntry(ColumnCaption caption)
 {
     return(ColumnCaptionResourceManagers
            .Any(resourceManager => null != resourceManager.GetString(caption.InvariantCaption)));
 }
Ejemplo n.º 14
0
 public string GetLocalizedColumnCaption(ColumnCaption columnCaption)
 {
     return DataSchemaLocalizer.LookupColumnCaption(columnCaption);
 }
Ejemplo n.º 15
0
 public string GetColumnCaption(ColumnCaption columnCaption, ColumnCaptionType columnCaptionType)
 {
     if (columnCaptionType == ColumnCaptionType.invariant)
     {
         return columnCaption.InvariantCaption;
     }
     return DataSchemaLocalizer.LookupColumnCaption(columnCaption);
 }
Ejemplo n.º 16
0
 protected bool Equals(ColumnCaption other)
 {
     return(string.Equals(InvariantCaption, other.InvariantCaption));
 }