本文整理汇总了C#中Rock.Model.DefinedValueService.LoadAttributes方法的典型用法代码示例。如果您正苦于以下问题:C# DefinedValueService.LoadAttributes方法的具体用法?C# DefinedValueService.LoadAttributes怎么用?C# DefinedValueService.LoadAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rock.Model.DefinedValueService
的用法示例。
在下文中一共展示了DefinedValueService.LoadAttributes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetChartStyle
/// <summary>
/// Sets the chart style.
/// </summary>
/// <param name="chartStyleDefinedValueGuid">The chart style defined value unique identifier.</param>
public void SetChartStyle( Guid? chartStyleDefinedValueGuid )
{
ChartStyle chartStyle = null;
if ( chartStyleDefinedValueGuid.HasValue )
{
var rockContext = new Rock.Data.RockContext();
var definedValue = new DefinedValueService( rockContext ).Get( chartStyleDefinedValueGuid.Value );
if ( definedValue != null )
{
definedValue.LoadAttributes( rockContext );
chartStyle = ChartStyle.CreateFromJson( definedValue.Value, definedValue.GetAttributeValue( "ChartStyle" ) );
}
}
SetChartStyle( chartStyle ?? new ChartStyle() );
}
示例2: gLinks_RowSelected
/// <summary>
/// Handles the RowSelected event of the gLinks control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="RowEventArgs"/> instance containing the event data.</param>
protected void gLinks_RowSelected( object sender, RowEventArgs e )
{
dlgLink.Title = "Edit Link";
using ( var rockContext = new RockContext() )
{
var dv = new DefinedValueService( rockContext ).Get( e.RowKeyId );
if ( dv != null )
{
dv.LoadAttributes();
bool isLink = dv.GetAttributeValue( "IsLink" ).AsBoolean( true );
hfDefinedValueId.Value = dv.Id.ToString(); ;
tbTitle.Text = dv.Value;
rblLinkType.SelectedValue = isLink ? "Link" : "Heading";
tbLink.Text = dv.Description;
tbLink.Visible = isLink;
ShowDialog( "Link", true );
}
}
}