本文整理汇总了C#中Rock.Show方法的典型用法代码示例。如果您正苦于以下问题:C# Rock.Show方法的具体用法?C# Rock.Show怎么用?C# Rock.Show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rock
的用法示例。
在下文中一共展示了Rock.Show方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessSelection
/// <summary>
/// Processes the selection, save state and navigates to the next page if no errors
/// are encountered during processing the activity.
/// </summary>
/// <param name="modalAlert">The modal alert control to show if errors occur.</param>
/// <param name="doNotProceedCondition">A condition that must be met after processing
/// the activity in order to save state and continue to the next page.</param>
/// <param name="conditionMessage">The message to display in the modal if the condition fails.</param>
/// <param name="validateSelectionRequired">if set to <c>true</c> will check that block on next page has a selection required before redirecting.</param>
/// <returns></returns>
protected virtual bool ProcessSelection( Rock.Web.UI.Controls.ModalAlert modalAlert, Func<bool> doNotProceedCondition, string conditionMessage, bool validateSelectionRequired )
{
var errors = new List<string>();
string workflowActivity = GetAttributeValue( "WorkflowActivity" );
if ( string.IsNullOrEmpty( workflowActivity ) || ProcessActivity( workflowActivity, out errors ) )
{
if ( doNotProceedCondition() )
{
modalAlert.Show( conditionMessage, Rock.Web.UI.Controls.ModalAlertType.Warning );
return false;
}
else
{
SaveState();
NavigateToNextPage( validateSelectionRequired );
return true;
}
}
else
{
string errorMsg = "<ul><li>" + errors.AsDelimited( "</li><li>" ) + "</li></ul>";
modalAlert.Show( errorMsg.Replace( "'", @"\'" ), Rock.Web.UI.Controls.ModalAlertType.Warning );
return false;
}
}
示例2: ProcessSelection
/// <summary>
/// Processes the selection, save state and navigates to the next page if no errors
/// are encountered during processing the activity.
/// </summary>
/// <param name="modalAlert">The modal alert control to show if errors occur.</param>
/// <returns>a list of errors encountered during processing the activity</returns>
protected virtual List<string> ProcessSelection( Rock.Web.UI.Controls.ModalAlert modalAlert )
{
var errors = new List<string>();
string workflowActivity = GetAttributeValue( "WorkflowActivity" );
if ( string.IsNullOrEmpty( workflowActivity ) || ProcessActivity( workflowActivity, out errors ) )
{
SaveState();
NavigateToNextPage();
}
else
{
string errorMsg = "<ul><li>" + errors.AsDelimited( "</li><li>" ) + "</li></ul>";
modalAlert.Show( errorMsg.Replace( "'", @"\'" ), Rock.Web.UI.Controls.ModalAlertType.Warning );
}
return errors;
}