示例#1
0
文件: Program.cs 项目: ojji/Resub
        private static void Main(string[] args)
        {
            if (args.Length == 0 || args[0] == "-help" || args[0] == "/?")
            {
                Console.WriteLine(ResubOptions.GetHelp());
                return;
            }
            var options = new ResubOptions(args);

            if (!options.IsValid)
            {
                Console.WriteLine(ResubOptions.GetHelp());
                return;
            }

            var resub = new Resub(options);

            try
            {
                resub.ReadjustSubtitles();
            }
            catch (Exception exception)
            {
                Console.WriteLine($"Error adjusting: {exception.GetType().Name} ({exception.Message})");
            }
        }
示例#2
0
文件: Resub.cs 项目: ojji/Resub
 /// <exception cref="ArgumentException">Invalid Resub options.</exception>
 public Resub(ResubOptions options)
 {
     _options = options;
     if (options == null || !options.IsValid)
     {
         throw new ArgumentException("Resub options must be valid.");
     }
 }