Example #1
0
 public void TestDataBindingChildDisplayName()
 {
     var dataSchema = new DataSchema();
     var coldescRoot = ColumnDescriptor.RootColumn(dataSchema, typeof (RowValue));
     var coldescRetentionTime = coldescRoot.ResolveChild("RetentionTime");
     var coldescMinRetentionTime = coldescRetentionTime.ResolveChild("Min");
     var coldescMeanRetentionTime = coldescRetentionTime.ResolveChild("Mean");
     Assert.AreEqual("MinRetentionTime", dataSchema.GetColumnCaption(coldescMinRetentionTime).InvariantCaption);
     Assert.AreEqual("AverageRetentionTime", dataSchema.GetColumnCaption(coldescMeanRetentionTime).InvariantCaption);
     var coldescParent = coldescRoot.ResolveChild("Parent");
     var coldescParentRetentionTime = coldescParent.ResolveChild("RetentionTime");
     var coldescParentMeanRetentionTime = coldescParentRetentionTime.ResolveChild("Mean");
     Assert.AreEqual("Parent", dataSchema.GetColumnCaption(coldescParent).InvariantCaption);
     Assert.AreEqual("ParentRetentionTime", dataSchema.GetColumnCaption(coldescParentRetentionTime).InvariantCaption);
     Assert.AreEqual("ParentAverageRetentionTime", dataSchema.GetColumnCaption(coldescParentMeanRetentionTime).InvariantCaption);
 }
Example #2
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));
        }
Example #3
0
        public string GetColumnCaption(PivotKey pivotKey, ColumnCaptionType columnCaptionType)
        {
            string columnCaption;

            if (null != ColumnSpec.Caption)
            {
                columnCaption = ColumnSpec.Caption;
            }
            else if (null == ColumnDescriptor)
            {
                columnCaption = PropertyPath.ToString();
            }
            else
            {
                columnCaption = DataSchema.GetColumnCaption(DataSchema.GetColumnCaption(ColumnDescriptor), columnCaptionType);
            }
            return(QualifyColumnCaption(pivotKey, columnCaption));
        }
Example #4
0
 public string GetColumnCaption(ColumnCaptionType columnCaptionType)
 {
     return(DataSchema.GetColumnCaption(this).GetCaption(DataSchema.GetDataSchemaLocalizer(columnCaptionType)));
 }
 public void GenerateResXFile(TextWriter writer, DataSchema dataSchema, ICollection<Type> startingTypes)
 {
     var allColumnCaptions = new HashSet<ColumnCaption>();
     foreach (var columnDescriptor in EnumerateAllColumnDescriptors(dataSchema, startingTypes))
     {
         allColumnCaptions.Add(dataSchema.GetColumnCaption(columnDescriptor));
     }
     WriteResXFile(writer, allColumnCaptions);
 }
Example #6
0
 public string GetColumnCaption(ColumnCaptionType columnCaptionType)
 {
     return(DataSchema.GetColumnCaption(DataSchema.GetColumnCaption(this), columnCaptionType));
 }