示例#1
0
 public static void UnknownPathError(string message, NLog.Logger logger)
 {
     LoggerUtils.LogMessage(message +
                            ". Write the locations of the Testlab installers. " +
                            "It should be a folder named Test.Lab that contains releases.",
                            (LogLevel)LogLevel.Error, logger);
 }
示例#2
0
        private async Task RefreshAsync()
        {
            try
            {
                LoggerUtils.LogMessage("Search installed components will start", (LogLevel)LogLevel.Info, UninstallerViewModel.logger);
                Stopwatch watch = Stopwatch.StartNew();
                this.UninstallBarInProgress = true;
                await Task.Run((Action)(() => this.List = new ObservableCollection <NameObject>((IEnumerable <NameObject>) this.GetProducts())));

                watch.Stop();
                DateTime elapsedTime = DateTime.MinValue.AddMilliseconds((double)watch.ElapsedMilliseconds);
                Dialogs.ElapsedTime("Search installed components", elapsedTime, UninstallerViewModel.logger);
                watch = (Stopwatch)null;
            }
            catch (Exception ex)
            {
                this.List = new ObservableCollection <NameObject>();
                Dialogs.UnknownError(ex.Message, UninstallerViewModel.logger);
            }
            finally
            {
                this.UninstallBarInProgress = false;
                this.SaveAllApplicationsFound();
            }
        }
示例#3
0
 public static void ElapsedTime(string message, DateTime elapsedTime, NLog.Logger logger)
 {
     LoggerUtils.LogMessage(message + " completed in " +
                            string.Format("{0} hours ", (object)elapsedTime.Hour) +
                            string.Format("{0} minutes and ", (object)elapsedTime.Minute) +
                            string.Format("{0} seconds.", (object)elapsedTime.Second),
                            (LogLevel)LogLevel.Info, logger);
 }
示例#4
0
 public static void DependencyFoundError(string firstName, string secondName, NLog.Logger logger)
 {
     LoggerUtils.LogMessage("Application " + firstName +
                            " depends on application " + secondName +
                            ". You need to uninstall " + secondName +
                            " if you want to uninstall " + firstName + ".",
                            (LogLevel)LogLevel.Warn, logger);
 }
示例#5
0
        private async Task UninstallProgramsAsync(DataGrid uninstallDataGrid)
        {
            if ((uint)uninstallDataGrid.SelectedItems.Count <= 0U)
            {
                return;
            }
            try
            {
                ObservableCollection <NameObject> selectedItemsList = new ObservableCollection <NameObject>();
                this.CopyListToList(uninstallDataGrid.SelectedItems, (IList)selectedItemsList);
                this.UninstallBarInProgress = true;
                if (this.IsDependencyFound(selectedItemsList))
                {
                    this.UninstallBarInProgress = false;
                }
                else
                {
                    LoggerUtils.LogMessage("Uninstall opperation will start", (LogLevel)LogLevel.Info, UninstallerViewModel.logger);
                    Stopwatch watch = Stopwatch.StartNew();
                    await this.UninstallListOfPrograms(selectedItemsList);

                    watch.Stop();
                    DateTime elapsedTime = DateTime.MinValue.AddMilliseconds((double)watch.ElapsedMilliseconds);
                    Dialogs.ElapsedTime("Uninstall opperation", elapsedTime, UninstallerViewModel.logger);
                    selectedItemsList = (ObservableCollection <NameObject>)null;
                    watch             = (Stopwatch)null;
                }
            }
            catch (Exception ex)
            {
                Dialogs.UnknownError(ex.Message, UninstallerViewModel.logger);
            }
            finally
            {
                this.UninstallBarInProgress = false;
            }
        }
示例#6
0
 public LoggerViewModel()
 {
     this.LoadData();
     LoggerUtils.LogMessage("Logger up and running", (LogLevel)LogLevel.Info, LoggerViewModel.logger);
 }
示例#7
0
 public static void DependenciesAdded(NLog.Logger logger)
 {
     LoggerUtils.LogMessage("Dependencies were saved successfully",
                            (LogLevel)LogLevel.Info, logger);
 }
示例#8
0
 public static void DependenciesAddedError(NLog.Logger logger)
 {
     LoggerUtils.LogMessage("The dependencies could not be saved",
                            (LogLevel)LogLevel.Error, logger);
 }
示例#9
0
 public static void NoApplications(NLog.Logger logger)
 {
     LoggerUtils.LogMessage("There have been no applications found. " +
                            "Use the search button in the Uninstaller tab to update this list.",
                            (LogLevel)LogLevel.Warn, logger);
 }
示例#10
0
 public static void PathModified(string path, NLog.Logger logger)
 {
     LoggerUtils.LogMessage("Current path: " + path,
                            (LogLevel)LogLevel.Info, logger);
 }
示例#11
0
 public static void SavePathError(string path, NLog.Logger logger)
 {
     LoggerUtils.LogMessage("The path: " +
                            path + " could not be saved",
                            (LogLevel)LogLevel.Error, logger);
 }
示例#12
0
 public static void UnknownError(string message, NLog.Logger logger)
 {
     LoggerUtils.LogMessage(message, (LogLevel)LogLevel.Error, logger);
 }
示例#13
0
 public static void InstallationFailed(string path, NLog.Logger logger)
 {
     LoggerUtils.LogMessage("Installation failed for " +
                            Path.GetFileName(path) + ", path " + path + ".",
                            (LogLevel)LogLevel.Error, logger);
 }
 private void MainWindow_Closed(object sender, EventArgs e)
 {
     LoggerUtils.LogMessage("Program closed.", LogLevel.Info, logger);
     Application.Current.Shutdown();
 }