private void IncludeFileToProject(IProject project, string xmlFolder, bool recursion) { try { telemetryTracker.StartTrackRequest("Adding xml file into Studio"); telemetryTracker.TrackEvent("Adding xml file into Studio", null); project.AddFolderWithFiles(xmlFolder, recursion); var projectFiles = project.GetSourceLanguageFiles(); var addedFileId = GetXmlFileId(); var scan = project.RunAutomaticTask(new Guid[] { addedFileId }, AutomaticTaskTemplateIds.Scan); OnProgress(70); var convertTask = project.RunAutomaticTask(new Guid[] { addedFileId }, AutomaticTaskTemplateIds.ConvertToTranslatableFormat); OnProgress(90); var copyTask = project.RunAutomaticTask(new Guid[] { addedFileId }, AutomaticTaskTemplateIds.CopyToTargetLanguages); OnProgress(100); } catch (Exception e) { telemetryTracker.TrackException(new ProjectTermsException(PluginResources.Error_AddXMlToProject + e.Message)); telemetryTracker.TrackTrace((new ProjectTermsException(PluginResources.Error_AddXMlToProject + e.Message)).StackTrace, Microsoft.ApplicationInsights.DataContracts.SeverityLevel.Error); throw new ProjectTermsException(PluginResources.Error_AddXMlToProject + e.Message); } }