/// <summary> /// Creates the message as <see cref="Literal"/>. /// </summary> /// <param name="message">The message.</param> /// <returns></returns> public static Literal CreateMessage(string message) { return(new Literal() { Text = CommonDefinitions.Convert2ErrorMessageFormat(message) }); }
/// <summary> /// If LastActionResult is not equal Success new <see cref="Literal"/> is created and the <paramref name="controlsAdd"/> action is called to add it to the controls. /// </summary> /// <param name="controlsAdd">The action used to add new <see cref="Literal"/> containing information about current result to the controls.</param> public void CreateActionResultControl(Action <Literal> controlsAdd) { if (this.LastActionResult == GenericStateMachineEngine.ActionResult.Result.Success) { return; } if (this.LastActionResult == GenericStateMachineEngine.ActionResult.Result.Exception) { string _format = CommonDefinitions.Convert2ErrorMessageFormat("Exception at: {0} of : {2}."); controlsAdd(new Literal() { Text = String.Format(_format, this.ActionException.Source, this.ActionException.Message) }); } else { string _format = CommonDefinitions.Convert2ErrorMessageFormat("Validation error at: {0}/{1} of : {2}."); controlsAdd(new Literal() { Text = String.Format(_format, this.ActionException.Message) }); } }