private static void RunCommandLine(string[] args) { if (args.Length != 1) { Console.WriteLine("Too many arguments specified"); return; } string filePath = args[0]; if (!File.Exists(filePath)) { Console.WriteLine("Specified file not found"); return; } try { if (Path.GetExtension(filePath).Equals(".ass", StringComparison.InvariantCultureIgnoreCase)) { SubtitleDocument doc = new AssDocument(filePath, AssStyleOptionsList.Load()); new YttDocument(doc).Save(Path.ChangeExtension(filePath, ".ytt")); } else { SubtitleDocument doc = SubtitleDocument.Load(filePath); new SrtDocument(doc).Save(Path.ChangeExtension(filePath, ".srt")); } } catch (Exception ex) { Console.WriteLine($"Error occurred: {ex}"); } }
public MainForm() { InitializeComponent(); LocalizeUI(); _styleOptions = AssStyleOptionsList.Load().ToDictionary(o => o.Name); ExpandCollapseStyleOptions(); ClearUi(); }
public MainForm() { InitializeComponent(); _windowsScaleFactor = AutoScaleDimensions.Height / 12; LocalizeUI(); _styleOptions = AssStyleOptionsList.Load().ToDictionary(o => o.Name); ExpandCollapseStyleOptions(); ClearUi(); }