本文整理汇总了C#中System.ComponentModel.Model.GetMediumDataValue方法的典型用法代码示例。如果您正苦于以下问题:C# Model.GetMediumDataValue方法的具体用法?C# Model.GetMediumDataValue怎么用?C# Model.GetMediumDataValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.ComponentModel.Model
的用法示例。
在下文中一共展示了Model.GetMediumDataValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppendMediumData
private void AppendMediumData( Model.Communication communication, StringBuilder sb, string key )
{
string value = communication.GetMediumDataValue( key );
if ( !string.IsNullOrWhiteSpace( value ) )
{
AppendMediumData( sb, key, value );
}
}
示例2: GetMessageDetails
/// <summary>
/// Gets the read-only message details.
/// </summary>
/// <param name="communication">The communication.</param>
/// <returns></returns>
public override string GetMessageDetails( Model.Communication communication )
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("<div class='row'>");
sb.AppendLine( "<div class='col-md-6'>" );
AppendMediumData( communication, sb, "FromName" );
AppendMediumData( communication, sb, "FromAddress" );
AppendMediumData( communication, sb, "ReplyTo" );
AppendMediumData( communication, sb, "Subject" );
sb.AppendLine( "</div>" );
sb.AppendLine( "<div class='col-md-6'>" );
AppendAttachmentData( sb, communication.GetMediumDataValue( "Attachments" ) );
sb.AppendLine( "</div>" );
sb.AppendLine( "</div>" );
string value = communication.GetMediumDataValue( "HtmlMessage" );
if (!string.IsNullOrWhiteSpace(value))
{
AppendMediumData( sb, "HtmlMessage", string.Format( @"
<iframe id='js-email-body-iframe' class='email-body'></iframe>
<script id='email-body' type='text/template'>{0}</script>
<script type='text/javascript'>
var doc = document.getElementById('js-email-body-iframe').contentWindow.document;
doc.open();
doc.write('<html><head><title></title></head><body>' + $('#email-body').html() + '</body></html>');
doc.close();
</script>
", value ) );
}
AppendMediumData( communication, sb, "TextMessage" );
return sb.ToString();
}