コード例 #1
0
        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}");
            }
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: okutasan/YTSubConverter
        public MainForm()
        {
            InitializeComponent();

            LocalizeUI();

            _styleOptions = AssStyleOptionsList.Load().ToDictionary(o => o.Name);
            ExpandCollapseStyleOptions();
            ClearUi();
        }
コード例 #3
0
        public MainForm()
        {
            InitializeComponent();
            _windowsScaleFactor = AutoScaleDimensions.Height / 12;

            LocalizeUI();

            _styleOptions = AssStyleOptionsList.Load().ToDictionary(o => o.Name);
            ExpandCollapseStyleOptions();
            ClearUi();
        }