Exemplo n.º 1
0
        /// <summary>
        /// Creates the message.
        /// </summary>
        /// <param name="at">At.</param>
        /// <param name="details">if set to <c>true</c> a string representation of the frames on the call stack at the time the current exception was thrown is also provided.</param>
        /// <returns><see cref="Literal"/> providing the formated exception message.</returns>
        public Literal CreateMessage(string at, bool details)
        {
            Literal _return = new Literal()
            {
                Text = CommonDefinitions.Convert2ErrorMessageFormat(Message)
            };

            if (details)
            {
                _return.Text += "Stack trace: + " + StackTrace;
            }
            return(_return);
        }
        private void ShowActionResult(GenericStateMachineEngine.ActionResult _rslt)
        {
            if (_rslt.LastActionResult == GenericStateMachineEngine.ActionResult.Result.Success)
            {
                return;
            }
            if (_rslt.LastActionResult == GenericStateMachineEngine.ActionResult.Result.Exception)
            {
#if DEBUG
                string _format = CommonDefinitions.Convert2ErrorMessageFormat("Exception at: {0}/{1} of : {2}.");
                this.Controls.Add(GlobalDefinitions.ErrorLiteralControl(String.Format(_format, _rslt.ActionException.Source, At, _rslt.ActionException.Message)));
#endif
                Anons.WriteEntry(EDC, _rslt.ActionException.Source, _rslt.ActionException.Message);
            }
            else
            {
                string _format = CommonDefinitions.Convert2ErrorMessageFormat("Validation error at: {0}/{1} of : {2}.");
                this.Controls.Add(GlobalDefinitions.ErrorLiteralControl(String.Format(_format, _rslt.ActionException.Source, At, _rslt.ActionException.Message)));
            }
        }