protected void ShowConnectivityError()
 {
     if (!Presenter.RemoteNotInitializedExceptionAlredyFired)
     {
         Presenter.RemoteNotInitializedExceptionAlredyFired = true;
         _displayMessage.ShowError(Messages.Profiles.Connectivity.Errors.ProfileDamaged, Messages.Profiles.Connectivity.Errors.RemoteFoldermissing);
     }
 }
        public bool ShowValidationError(IEnumerable <string> errorList)
        {
            var errorBuilder = new StringBuilder(Code.Statics.Validation.General.ErrorsList);

            foreach (var error in errorList)
            {
                errorBuilder.AppendLine(error);
            }

            if (errorList.Any())
            {
                _displayMessage.ShowError(Code.Statics.Validation.General.MessageBoxCapture, errorBuilder.ToString());
            }

            return(!errorList.Any());
        }
Exemple #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var onStart = new OnStart();

            if (onStart.EnsureAdminRights() && onStart.IsValid)
            {
                try
                {
                    onStart.EnableLogger();
                    SimpleLog.Info("Sifon started.");

                    Application.Run(new Main());
                    SimpleLog.Info("Sifon finished.");
                }
                catch (Exception e)
                {
                    if (e.InnerException is RemoteNotInitializedException)
                    {
                        if (DisplayMessage.ShowYesNo(Messages.General.YesNoCaption, Messages.Program.NoRemoteFolder))
                        {
                            var initializeForm = new InitRemote
                            {
                                StartPosition  = FormStartPosition.CenterParent,
                                RemoteSettings = Create.New <IProfilesProvider>().SelectedProfile
                            };
                            if (initializeForm.ShowDialog() == DialogResult.OK && initializeForm.RemoteFolder.NotEmpty())
                            {
                                initializeForm.Dispose();
                                Application.Run(new Main());
                            }
                            else
                            {
                                DisplayMessage.ShowError(Messages.Program.InitializeFailure, Messages.Program.CannotContinueRemoting);
                            }
                        }
                        else
                        {
                            DisplayMessage.ShowError(Messages.Program.RemoteExecutionError, Messages.Program.CannotContinueRemoting);
                        }
                    }
                    else
                    {
                        DisplayMessage.ShowError(Messages.Program.ExecutionError, Messages.Program.CannotContinueGeneric);
                        DisplayMessage.ShowError(e.Message, $"{e.Message}{Environment.NewLine}{e.StackTrace}");
                    }

                    var _settingsProvider = Create.New <ISettingsProvider>();
                    var _apiProvider      = new ApiProvider <bool> {
                        EnableSendingExceptions = _settingsProvider.Read().SendCrashDetails
                    };

                    Task.Run(async() =>
                    {
                        var submitResult = await _apiProvider.SendException(e);
                    }
                             ).GetAwaiter().GetResult();

                    SimpleLog.Log(e);

                    int k = 0;
                }
            }
        }
Exemple #4
0
 protected internal void ShowError(string caption, string message)
 {
     _displayMessage.ShowError(caption, message);
 }
Exemple #5
0
 public void ShowError(string caption, string message)
 {
     _displayMessage.ShowError(caption, message);
 }