void _bw_DoWork(object sender, DoWorkEventArgs e) { if (e.Argument == null) { return; } var taskArgument = (TaskArgument)e.Argument; var mpService = new MigrateProjectsService(taskArgument.SourceStudioVersion, taskArgument.DestinationStudioVersion); //remove the Select al project object which coresponds with to the first line in the list view var selectAllProjectsObj = taskArgument.Projects.FirstOrDefault(s => s.Name == @"Select all projects"); if (selectAllProjectsObj != null) { taskArgument.Projects.Remove(selectAllProjectsObj); } var selectAllProj = taskArgument.ProjectToBeMoved.FirstOrDefault(s => s.Name == @"Select all projects"); if (selectAllProj != null) { taskArgument.ProjectToBeMoved.Remove(selectAllProj); } _projects = taskArgument.ProjectToBeMoved; mpService.MigrateProjects(taskArgument.Projects, taskArgument.ProjectToBeMoved, taskArgument.MigrateCustomers, _bw.ReportProgress); _bw.ReportProgress(95); if (taskArgument.MigrateTranslationMemories) { mpService.MigrateTranslationMemories(); } if (taskArgument.PluginsToBeMoved.Count > 0) { var selectAllPlugins = taskArgument.PluginsToBeMoved.FirstOrDefault(s => s.PluginName == @"Select all plugins"); if (selectAllPlugins != null) { taskArgument.PluginsToBeMoved.Remove(selectAllPlugins); } MovePlugins(taskArgument.PluginsToBeMoved, taskArgument.SourceStudioVersion.ExecutableVersion.Major); } _bw.ReportProgress(100); }
void _bw_DoWork(object sender, DoWorkEventArgs e) { if (e.Argument == null) { return; } var taskArgument = (TaskArgument)e.Argument; var mpService = new MigrateProjectsService(taskArgument.SourceStudioVersion, taskArgument.DestinationStudioVersion); mpService.MigrateProjects(taskArgument.Projects, taskArgument.ProjectToBeMoved, _bw.ReportProgress); _bw.ReportProgress(95); if (taskArgument.MigrateTranslationMemories) { mpService.MigrateTranslationMemories(); } _bw.ReportProgress(100); }