当前位置: 首页>>代码示例>>C#>>正文


C# Rock.Show方法代码示例

本文整理汇总了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;
            }
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:36,代码来源:CheckInBlock.cs

示例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;
        }
开发者ID:azturner,项目名称:Rock,代码行数:24,代码来源:CheckInBlock.cs


注:本文中的Rock.Show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。