示例#1
0
        public static void ShowMessage(XafApplication application, string message,
                                       InformationType type         = InformationType.Success,
                                       InformationPosition position = InformationPosition.Bottom,
                                       int duration = 2000)
        {
            if (application == null)
            {
                return;
            }
            MessageOptions options = new MessageOptions();

            options.Duration     = duration;
            options.Message      = message;
            options.Type         = type;
            options.Web.Position = position;
            application.ShowViewStrategy.ShowMessage(options);
        }
示例#2
0
        public static void ShowErrorMessage(XafApplication Application, Exception Exception, InformationPosition Position)
        {
            Employee employee = GetEmployee(Application);

            MessageOptions options = new MessageOptions {
                Duration = 5000,
                Message  = string.Format(Exception == null ? "Unknown Error" : Exception.ToString()),
                Type     = InformationType.Error
            };

            options.Web.Position = Position;
            Application.ShowViewStrategy.ShowMessage(options);

            if (employee != null)
            {
                ExceptionlessClient.Default.CreateLog("My Workbench", Exception.ToString(), LogLevel.Error.ToString()).MarkAsCritical().SetUserDescription(employee.Email, employee.FullName);
            }
            else
            {
                ExceptionlessClient.Default.CreateLog("My Workbench", Exception.ToString(), LogLevel.Error.ToString()).MarkAsCritical();
            }
        }
示例#3
0
        public static void ShowSuccessMessage(XafApplication Application, string Message, InformationPosition Position)
        {
            Employee employee = GetEmployee(Application);

            MessageOptions options = new MessageOptions {
                Duration = 5000,
                Message  = string.Format(Message),
                Type     = InformationType.Success
            };

            options.Web.Position = Position;
            Application.ShowViewStrategy.ShowMessage(options);

            if (employee != null)
            {
                ExceptionlessClient.Default.CreateLog(ExceptionSources.MyWorkbenchCloud.ToString(), Message, LogLevel.Info.ToString()).SetUserDescription(employee.Email, employee.FullName);
            }
            else
            {
                ExceptionlessClient.Default.CreateLog(ExceptionSources.MyWorkbenchCloud.ToString(), Message, LogLevel.Info.ToString());
            }
        }
示例#4
0
        public static void ShowErrorMessages(XafApplication Application, List <Exception> Exceptions, InformationPosition Position)
        {
            string   exceptions = string.Empty;
            Employee employee   = GetEmployee(Application);

            foreach (Exception exception in Exceptions)
            {
                if (exceptions == string.Empty)
                {
                    exceptions = string.Format(exception == null ? "Unknown Error" : exception.ToString());
                }
                else
                {
                    exceptions = ", " + string.Format(exception == null ? "Unknown Error" : exception.ToString());
                }
            }

            MessageOptions options = new MessageOptions {
                Duration = 5000,
                Message  = string.Format(new Exception(exceptions).ToString()),
                Type     = InformationType.Error
            };

            options.Web.Position = Position;
            Application.ShowViewStrategy.ShowMessage(options);

            if (employee != null)
            {
                ExceptionlessClient.Default.CreateLog(ExceptionSources.MyWorkbenchCloud.ToString(), exceptions, LogLevel.Error.ToString()).MarkAsCritical().SetUserDescription(employee.Email, employee.FullName);
            }
            else
            {
                ExceptionlessClient.Default.CreateLog(ExceptionSources.MyWorkbenchCloud.ToString(), exceptions, LogLevel.Error.ToString()).MarkAsCritical();
            }
        }
 private void ExecuteErrorMessage(Controller Controller, Exception Exception, InformationPosition Position)
 {
     ToastMessageHelper.ShowErrorMessage(Controller.Application, Exception, Position);
 }
 private void ExecuteWarningMessage(Controller Controller, string Message, InformationPosition Position)
 {
     ToastMessageHelper.ShowWarningMessage(Controller.Application, Message, Position);
 }
示例#7
0
 public MessageInformation(Guid UserID, MessageTypes MessageType, string MessageText, InformationPosition Position)
 {
     this.Oid         = Guid.NewGuid();
     this.MessageType = MessageType;
     this.MessageText = MessageText;
     this.Position    = Position;
 }