本文整理汇总了C#中System.Data.Node.TryGetLabel方法的典型用法代码示例。如果您正苦于以下问题:C# Node.TryGetLabel方法的具体用法?C# Node.TryGetLabel怎么用?C# Node.TryGetLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.Node
的用法示例。
在下文中一共展示了Node.TryGetLabel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildReportRowProperties
/// <summary>
/// Updates a <paramref name="row"/> with relevant properties from the taxonomy.
/// </summary>
/// <param name="report">[Obsolete]</param>
/// <param name="parent">The <see cref="Node"/> which created this <paramref name="row"/>.</param>
/// <param name="row">The row to be updated.</param>
/// <seealso cref="BuildReportRows"/>
private void BuildReportRowProperties( InstanceReport report, Node parent, InstanceReportRow row )
{
row.BalanceType = parent.BalanceType;
row.Id = report.Rows.Count + 1;
row.IsReverseSign = InstanceUtils.IsDisplayReversed( parent );
row.PreferredLabelRole = parent.PreferredLabel;
row.IsBeginningBalance = InstanceUtils.IsBeginningBalance( row );
row.IsEndingBalance = InstanceUtils.IsEndingBalance( row );
row.PeriodType = parent.PeriodType;
//apply the element label
string label = null;
if( !string.IsNullOrEmpty( row.PreferredLabelRole ) && parent.TryGetLabel( this.preferredLanguage, row.PreferredLabelRole, out label ) )
row.Label = label;
else if( parent.TryGetLabel( this.preferredLanguage, "label", out label ) )
row.Label = label;
else
row.Label = string.Format( "[{0}]", parent.Name );
//apply element properties
Element element = parent.MyElement;
if( element == null && !elementCache.TryGetValue( parent.Id, out element ) )
{
element =
this.elementCache[ parent.Id ] =
this.currentTaxonomy.AllElements[ parent.Id ] as Element;
}
if( element == null )
{
Debug.Assert( false, "Why isn't this element in the taxonomy?" );
}
else
{
if( row.Cells != null && row.Cells.Count > 0 )
{
if( !this.presentationElements.ContainsKey( parent.Id ) )
this.presentationElements[ parent.Id ] = 0;
this.presentationElements[ parent.Id ]++;
}
row.ElementDataType = element.OrigElementType;
row.ElementName = parent.Id;
row.ElementPrefix = parent.Id.Substring( 0, parent.Id.IndexOf( '_' ) + 1 );
row.IsBaseElement = row.ElementPrefix.StartsWith( "usfr_" ) || row.ElementPrefix.StartsWith( "us-gaap_" );
row.SimpleDataType = element.MyDataType.ToString().ToLower();
DefAndRef dr;
if( this.dar.references.TryGetValue( parent.Id, out dr ) )
{
row.ElementDefenition = dr.Def;
row.ElementReferences = dr.Ref;
}
UnitType unit;
if( this.elementUnitTypes.TryGetValue( row.ElementName, out unit ) )
row.Unit = unit;
//perhaps the user used the wrong unit - attempt to find monetary, perShare
if( row.Unit == UnitType.Other || row.Unit == UnitType.Monetary )
{
if( element.OrigElementType.IndexOf( "perShare", StringComparison.CurrentCultureIgnoreCase ) > -1 )
row.Unit = UnitType.EPS;
}
}
if( BuilderRules.IsRuleEnabled( RulesEngineUtils.DISPLAY_US_DATE_FORMAT ) )
{
if( string.Equals( row.SimpleDataType, "date", StringComparison.CurrentCultureIgnoreCase ) )
{
foreach( Cell cell in row.Cells )
{
cell.DisplayDateInUSFormat = true;
}
}
}
}