本文整理汇总了C#中Person.GetAttributeValue方法的典型用法代码示例。如果您正苦于以下问题:C# Person.GetAttributeValue方法的具体用法?C# Person.GetAttributeValue怎么用?C# Person.GetAttributeValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Person
的用法示例。
在下文中一共展示了Person.GetAttributeValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetToolTipText
/// <summary>
/// Gets the tool tip text.
/// </summary>
/// <param name="person">The person.</param>
/// <returns></returns>
public override string GetToolTipText( Person person )
{
var attributeValue = person.GetAttributeValue("BaptismDate");
if (!string.IsNullOrWhiteSpace(attributeValue))
{
var date = DateTime.MinValue;
if (DateTime.TryParse(attributeValue, out date) && date > DateTime.MinValue)
{
return "Baptized on " + date.ToShortDateString();
}
}
return "No Baptism Date";
}
示例2: GetIconPath
/// <summary>
/// Gets the icon path.
/// </summary>
/// <param name="person">The person.</param>
/// <returns></returns>
public override string GetIconPath( Person person )
{
var attributeValue = person.GetAttributeValue( "BaptismDate" );
if ( !string.IsNullOrWhiteSpace( attributeValue ) )
{
var date = DateTime.MinValue;
if ( DateTime.TryParse( attributeValue, out date ) && date > DateTime.MinValue )
{
return Path.Combine( System.Web.VirtualPathUtility.ToAbsolute( "~" ), "Assets/Images/bap-e.png" );
}
}
return Path.Combine( System.Web.VirtualPathUtility.ToAbsolute( "~" ), "Assets/Images/bap-d.png" );
}
示例3: SetEditValues
/// <summary>
/// Sets the edit values.
/// </summary>
/// <param name="person">The person.</param>
public void SetEditValues(Person person)
{
EnsureChildControls();
int i = 0;
foreach ( var attribute in AttributeList )
{
attribute.FieldType.Field.SetEditValue(attribute.GetControl( Controls[i]), attribute.QualifierValues, person.GetAttributeValue(attribute.Key));
i++;
}
}