private void SaveXsltThreadSafe(IdReGenerator idReGenerator) { if (InvokeRequired) { SaveXsltCallback d = SaveXslt; Invoke(d, idReGenerator); } else { SaveXslt(idReGenerator); } }
private void SaveXslt(IdReGenerator idReGenerator) { if (saveXslDialog.ShowDialog() != DialogResult.OK) { return; } var fileName = saveXslDialog.FileName; Log("# Saving XSLT..."); File.WriteAllText(fileName, idReGenerator.ReshapingXsl.ToString()); Log($"# XSLT saved as '{fileName}'."); }
private void RegenerateIds() { if (!IsFolderSelected) { Log("WARNING: No folder selected: operating in execution directory."); } var paths = GetFilePaths(true); if (paths == null) { return; } var reshaper = new IdReGenerator(paths[0], paths.Skip(1).ToList(), Log); reshaper.RegenerateIds(); SaveXsltThreadSafe(reshaper); }