Esempio n. 1
0
        /// <summary>
        /// Inits the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        public void Init(MessagePacket message)
        {
            if (message == null)
            {
                return;
            }

            this.AssignSeverityImage(message.Severity);

            // Set the title text
            this.DialogTitle = message.GetTitle(CultureInfo.CurrentUICulture.ToString());

            // Set the message text
            this.ExceptionMessage = message.GetSummaryMessage(CultureInfo.CurrentUICulture.ToString());

            //Set the detail text
            StringBuilder detailMessage = new StringBuilder();

            detailMessage.Append(message.GetDetailMessage(CultureInfo.CurrentUICulture.ToString()));

            if (detailMessage.ToString().Length > 0)
            {
                this.ExceptionDetail = detailMessage.ToString();
                this.ShowExceptionDetail(true);
            }
            else
            {
                this.ShowExceptionDetail(false);
            }

            this.DataContext = this;
        }