public string GetDescription(DataSchema dataSchema) { var parts = new List <string>(); if (RowHeaders.Any()) { parts.Add(Resources.PivotSpec_GetDescription_Row_Headers_); parts.AddRange(RowHeaders.Select(header => header.Caption ?? header.SourceColumn.ToString())); } if (ColumnHeaders.Any()) { if (parts.Any()) { parts.Add(string.Empty); } parts.Add(Resources.PivotSpec_GetDescription_Column_Headers_); parts.AddRange(ColumnHeaders.Select(header => header.Caption ?? header.SourceColumn.ToString())); } if (Values.Any()) { if (parts.Any()) { parts.Add(string.Empty); } parts.Add(Resources.PivotSpec_GetDescription_Values_); parts.AddRange(Values.Select(value => (ColumnCaption.ExplicitCaption(value.Caption) ?? value.AggregateOperation.QualifyColumnCaption(value.SourceColumn.ToColumnCaption())) .GetCaption(dataSchema.DataSchemaLocalizer))); } return(string.Join(Environment.NewLine, parts)); }
public string GetUndoText(DataSchemaLocalizer dataSchemaLocalizer) { string fullMessage = string.Format(Resources.EditDescription_GetUndoText_Set__0__to___1__, ColumnCaption.GetCaption(dataSchemaLocalizer), Value); return(TruncateLongMessage(fullMessage)); }
private ListViewItem MakeListItem(PivotSpec.Column column, Func <IColumnCaption, IColumnCaption> captionMaker) { var pd = FindPropertyDescriptor(column.SourceColumn); var listViewItem = new ListViewItem(); if (column.Caption != null) { listViewItem.Text = column.Caption; listViewItem.Font = new Font(listViewItem.Font, FontStyle.Bold | listViewItem.Font.Style); } else if (pd != null) { listViewItem.Text = captionMaker(ColumnCaption.GetColumnCaption(pd)).GetCaption(DataSchemaLocalizer); } else { listViewItem.Text = captionMaker(ColumnCaption.UnlocalizableCaption(column.SourceColumn.ToString())).GetCaption(DataSchemaLocalizer); } if (pd == null) { listViewItem.Font = new Font(listViewItem.Font, FontStyle.Strikeout); listViewItem.ToolTipText = string.Format(Resources.PivotEditor_MakeListItem_Unable_to_find_column___0___, column.SourceColumn); } return(listViewItem); }
public ColumnCaption[] GetHeaderColumnCaptions(string[] periods, Guid periodTypeId) { EntitySchemaQuery periodEsq = GetForecastPeriodSelectQuery(periods, periodTypeId); EntityCollection periodCollection = periodEsq.GetEntityCollection(_userConnection); EntitySchemaQuery indicatorEsq = GetForecastIndicatorSelectQuery(); EntityCollection indicatorCollection = indicatorEsq.GetEntityCollection(_userConnection); List <ColumnCaption> columnCaptions = new List <ColumnCaption>(); foreach (Entity periodValue in periodCollection) { Guid periodId = GetEntityPrimaryColumnValue(periodValue); foreach (Entity indicatorValue in indicatorCollection) { string indicatorCode = (string)indicatorValue.GetColumnValue("Code"); ColumnCaption columnCaption = new ColumnCaption() { PeriodId = periodId, PeriodName = (string)periodValue.GetColumnValue("Name"), IndicatorName = (string)indicatorValue.GetColumnValue("Name"), IndicatorCode = indicatorCode, ColumnName = indicatorCode + periodId }; columnCaptions.Add(columnCaption); } } return(columnCaptions.ToArray()); }
public override IColumnCaption GetInvariantDisplayName(string uiMode, Type type) { if (typeof(ListItem).IsAssignableFrom(type)) { return(ColumnCaption.UnlocalizableCaption(ListItemTypes.INSTANCE.GetListName(type))); } return(base.GetInvariantDisplayName(uiMode, type)); }
public override int GetHashCode() { unchecked { int hashCode = (ColumnCaption != null ? ColumnCaption.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Predicate.GetHashCode(); return(hashCode); } }
public override int GetHashCode() { unchecked { int hashCode = (ColumnCaption != null ? ColumnCaption.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (FilterOperation != null ? FilterOperation.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Operand != null ? Operand.GetHashCode() : 0); return(hashCode); } }
private ListViewItem MakeListViewColumnItem(DisplayColumn displayColumn) { string listItemText = displayColumn.GetColumnCaption(null, ColumnCaptionType.localized); var listViewItem = new ListViewItem { Text = listItemText }; Debug.Assert(!displayColumn.ColumnSpec.Hidden); if (!string.IsNullOrEmpty(displayColumn.ColumnSpec.Caption)) { listViewItem.Font = new Font(listViewItem.Font, FontStyle.Bold | listViewItem.Font.Style); DataSchema dataSchema = displayColumn.DataSchema; ColumnCaption columnCaption = dataSchema.GetColumnCaption(displayColumn.ColumnDescriptor); listViewItem.ToolTipText = dataSchema.GetLocalizedColumnCaption(columnCaption); } return(listViewItem); }
public GroupAndTotaler(CancellationToken cancellationToken, DataSchema dataSchema, PivotSpec pivotSpec, IEnumerable <DataPropertyDescriptor> itemProperties) { CancellationToken = cancellationToken; DataSchema = dataSchema; var columnsByDisplayName = itemProperties.ToLookup(ColumnId.GetColumnId); RowHeaders = ImmutableList.ValueOf(pivotSpec.RowHeaders.SelectMany( col => columnsByDisplayName[col.SourceColumn] .Select(pd => Tuple.Create(pd, ColumnCaption.ExplicitCaption(col.Caption) ?? ColumnCaption.GetColumnCaption(pd))))); ColumnHeaders = ImmutableList.ValueOf(pivotSpec.ColumnHeaders.SelectMany( col => columnsByDisplayName[col.SourceColumn])); AggregateColumns = ImmutableList.ValueOf(pivotSpec.Values.SelectMany( col => columnsByDisplayName[col.SourceColumn] .Select(pd => Tuple.Create(pd, ColumnCaption.ExplicitCaption(col.Caption) ?? col.AggregateOperation.QualifyColumnCaption(ColumnCaption.GetColumnCaption(pd)), col.AggregateOperation)))); }
/// <summary> /// Returns an EditDescription corresponding to setting an annotation to a particular value. /// </summary> public static EditDescription SetAnnotation(AnnotationDef annotationDef, object value) { return(new EditDescription(ColumnCaption.UnlocalizableCaption(annotationDef.Name), value)); }
public EditDescription(ColumnCaption columnCaption, object value) { ColumnCaption = columnCaption; Value = value; }