本文整理汇总了C#中TableCell.SetupDisplayText方法的典型用法代码示例。如果您正苦于以下问题:C# TableCell.SetupDisplayText方法的具体用法?C# TableCell.SetupDisplayText怎么用?C# TableCell.SetupDisplayText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TableCell
的用法示例。
在下文中一共展示了TableCell.SetupDisplayText方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddVerticalKeyValues
/// <summary>
/// Add vertical key values to the specified output Row
/// </summary>
/// <param name="verticalPreviousValues">
/// A map of {key, previous value of key}
/// </param>
/// <param name="dimension">
/// The current key
/// </param>
/// <param name="outputRow">
/// The row to add the key values
/// </param>
/// <param name="currentValue">
/// The current value
/// </param>
/// <param name="model">
/// The dataset model
/// </param>
private void AddVerticalKeyValues(
IDictionary<string, TableCell> verticalPreviousValues,
string dimension,
TableRow outputRow,
string currentValue,
IDataSetModel model,
IDataReader currentRow)
{
this._uniqID++;
Table tb = new Table();
TableRow _rw = new TableRow();
Table tb_extra = (this._useSdmxAttr) ? CreateDimensionAttributeTable(dimension, model, currentRow) : null;
if (tb_extra != null)
{
tb_extra.AddAttribute("ID", this._uniqID + "_dim_info_extra_dialog");
tb_extra.AddClass(HtmlClasses.ExtraInfoTable);
tb.AddRow(new TableRow(new TableCell(tb_extra)));
var tb_btn_extra = new TableCell();
tb_btn_extra.AddClass(HtmlClasses.ExtraInfoWrapper);
tb_btn_extra.AddAttribute("ID", this._uniqID + "_dim_info");
_rw.AddCell(tb_btn_extra);
}
string text = this.GetLocalizedName(dimension, currentValue);
var tb_dim = new TableCell();
tb_dim.AddClass(HtmlClasses.VerticalKeyValue);
if (dimension == "TIME_PERIOD") tb_dim.AddAttribute("style", "white-space:nowrap");
tb_dim.SetupDisplayText(currentValue, text, dimension, model.GetDisplayMode(dimension, currentValue), this._enhancedOutput);
_rw.AddCell(tb_dim);
tb.AddRow(_rw);
TableCell tb_cell = new TableCell(tb);
outputRow.AddCell(tb_cell);
verticalPreviousValues[dimension] = tb_cell;
}
示例2: AddHorrizontalKeyValues
/// <summary>
/// Add horrizontal key values to the specified output Row
/// </summary>
/// <param name="horizontalPreviousValues">
/// A map of {key, previous value of key}
/// </param>
/// <param name="dimension">
/// The current key
/// </param>
/// <param name="outputRow">
/// The row to add the key values
/// </param>
/// <param name="currentValue">
/// The current value
/// </param>
/// <param name="model">
/// The dataset model
/// </param>
private void AddHorrizontalKeyValues(
IDictionary<string, TableCell> horizontalPreviousValues,
string dimension,
TableRow outputRow,
string currentValue,
IDataSetModel model,
IDataReader currentRow)
{
TableCell oldCell;
horizontalPreviousValues.TryGetValue(dimension, out oldCell);
string oldValue = string.Empty;
if (oldCell != null &&
oldCell.Children.Count > 0 &&
oldCell.Children[0].Children.Count > 0 &&
oldCell.Children[0].Children[0].Children.Count > 1)
oldValue = oldCell.Children[0].Children[0].Children[0].SdmxValue;
else if (oldCell != null)
oldValue = oldCell.SdmxValue;
if (oldCell != null && string.Equals(currentValue, oldValue))
{
oldCell.ColumnSpan++;
}
else
{
this._uniqID++;
Table tb = new Table();
TableRow _rw = new TableRow();
Table tb_extra = (this._useSdmxAttr) ? CreateDimensionAttributeTable(dimension, model, currentRow) : null;
if (tb_extra != null)
{
tb_extra.AddAttribute("ID", this._uniqID + "_dim_info_extra_dialog");
tb_extra.AddClass(HtmlClasses.ExtraInfoTable);
tb.AddRow(new TableRow(new TableCell(tb_extra)));
var tb_btn_extra = new TableCell();
tb_btn_extra.AddClass(HtmlClasses.ExtraInfoWrapper);
tb_btn_extra.AddAttribute("ID", this._uniqID + "_dim_info");
_rw.AddCell(tb_btn_extra);
}
string text = this.GetLocalizedName(dimension, currentValue);
var tb_dim = new TableCell();
tb_dim.AddClass(HtmlClasses.HorizontalKeyValue);
tb_dim.SetupDisplayText(currentValue, text, dimension, model.GetDisplayMode(dimension, currentValue), this._enhancedOutput);
if (dimension == "TIME_PERIOD") tb_dim.AddAttribute("style", "white-space:nowrap");
_rw.AddCell(tb_dim);
tb.AddRow(_rw);
TableCell tb_cell = new TableCell(tb);
tb_cell.SdmxValue = currentValue;
outputRow.AddCell(tb_cell);
horizontalPreviousValues[dimension] = tb_cell;
}
}
示例3: CreateSliceHeaderTable
/// <summary>
/// Create a slice header table that will contain the slice key titles and values
/// </summary>
/// <param name="state">
/// The current state
/// </param>
/// <returns>
/// The slice header table
/// </returns>
protected Table CreateSliceHeaderTable(RendererState state)
{
var table = new Table();
table.AddClass(HtmlClasses.SliceKeys);
table.AddAttribute(HtmlConstants.CellPadding, ZeroValue);
table.AddAttribute(HtmlConstants.CellSpacing, ZeroValue);
foreach (string key in state.Model.SliceKeys)
{
var row = new TableRow();
table.AddElement(row);
var value = state.InputRow[key] as string;
value = value ?? " ";
var title = new TableCell(state.Model.AllValidKeys[key]);
title.AddClass(HtmlClasses.SliceKeyTitle);
row.AddElement(title);
string text = this.GetLocalizedName(key, value);
var val = new TableCell();
// Implemented like in java to show description only
val.SetupDisplayText(value, text, key, DisplayMode.Description, false);
val.AddClass(HtmlClasses.SliceKeyValue);
row.AddElement(val);
}
return table;
}
示例4: CreateTitle
/// <summary>
/// Create a dimension (i.e. key) title
/// </summary>
/// <param name="title">
/// The title
/// </param>
/// <param name="dim">
/// The SDMX dimension id
/// </param>
/// <param name="clazz">
/// the HTML class of the title
/// </param>
/// <returns>
/// The <see cref="TableCell"/> with the <paramref name="title"/> as text
/// </returns>
private TableCell CreateTitle(string title, string dim, string clazz)
{
var tableCell = new TableCell(title);
tableCell.AddClass(clazz);
if (this._componentCodesDescriptionMap.ContainsKey(dim) && this._enhancedOutput)
{
tableCell.SetupDisplayText(dim);
}
return tableCell;
}
示例5: AddVerticalKeyValues2
/// <summary>
/// Add vertical key values to the specified output Row
/// </summary>
/// <param name="verticalPreviousValues">
/// A map of {key, previous value of key}
/// </param>
/// <param name="dimension">
/// The current key
/// </param>
/// <param name="outputRow">
/// The row to add the key values
/// </param>
/// <param name="currentValue">
/// The current value
/// </param>
/// <param name="model">
/// The dataset model
/// </param>
private void AddVerticalKeyValues2(
IDictionary<string, TableCell> verticalPreviousValues,
string dimension,
TableRow outputRow,
string currentValue,
IDataSetModel model)
{
var tableCell = new TableCell { Text = currentValue };
tableCell.AddClass(HtmlClasses.VerticalKeyValue);
string text = this.GetLocalizedName(dimension, currentValue);
tableCell.SetupDisplayText(
currentValue, text, dimension, model.GetDisplayMode(dimension, currentValue), this._enhancedOutput);
outputRow.AddCell(tableCell);
verticalPreviousValues[dimension] = tableCell;
}
示例6: AddHorrizontalKeyValues
/// <summary>
/// Add horrizontal key values to the specified output Row
/// </summary>
/// <param name="horizontalPreviousValues">
/// A map of {key, previous value of key}
/// </param>
/// <param name="dimension">
/// The current key
/// </param>
/// <param name="outputRow">
/// The row to add the key values
/// </param>
/// <param name="currentValue">
/// The current value
/// </param>
/// <param name="model">
/// The dataset model
/// </param>
private void AddHorrizontalKeyValues(
IDictionary<string, TableCell> horizontalPreviousValues,
string dimension,
TableRow outputRow,
string currentValue,
IDataSetModel model)
{
TableCell oldValue;
if (horizontalPreviousValues.TryGetValue(dimension, out oldValue) && oldValue != null
&& string.Equals(currentValue, oldValue.SdmxValue))
{
oldValue.ColumnSpan++;
}
else
{
var tableCell = new TableCell();
string text = this.GetLocalizedName(dimension, currentValue);
tableCell.SetupDisplayText(
currentValue, text, dimension, model.GetDisplayMode(dimension, currentValue), this._enhancedOutput);
tableCell.AddClass(HtmlClasses.HorizontalKeyValue);
outputRow.AddCell(tableCell);
horizontalPreviousValues[dimension] = tableCell;
}
}