public VisualSync(Control parentControl) { UiUtil.PreInitialize(this); InitializeComponent(); UiUtil.FixFonts(this); openFileDialog1.InitialDirectory = string.Empty; MediaPlayerStart.InitializeVolume(Configuration.Settings.General.VideoPlayerDefaultVolume); MediaPlayerEnd.InitializeVolume(Configuration.Settings.General.VideoPlayerDefaultVolume); labelSyncDone.Text = string.Empty; _language = LanguageSettings.Current.VisualSync; _languageGeneral = LanguageSettings.Current.General; Text = _language.Title; buttonOpenMovie.Text = _languageGeneral.OpenVideoFile; groupBoxMovieInfo.Text = _languageGeneral.VideoInformation; labelVideoInfo.Text = _languageGeneral.NoVideoLoaded; groupBoxStartScene.Text = _language.StartScene; groupBoxEndScene.Text = _language.EndScene; buttonStartThreeSecondsBack.Text = _language.ThreeSecondsBack; buttonThreeSecondsBack.Text = _language.ThreeSecondsBack; buttonStartHalfASecondBack.Text = _language.HalfASecondBack; buttonEndHalfASecondBack.Text = _language.HalfASecondBack; buttonStartVerify.Text = string.Format(_language.PlayXSecondsAndBack, Configuration.Settings.Tools.VerifyPlaySeconds); buttonEndVerify.Text = buttonStartVerify.Text; buttonGotoStartSubtitlePosition.Text = _language.GoToSubPosition; buttonGotoEndSubtitlePosition.Text = _language.GoToSubPosition; buttonFindTextStart.Text = _language.FindText; buttonFindTextEnd.Text = _language.FindText; buttonSync.Text = _language.Synchronize; buttonOK.Text = _languageGeneral.Ok; buttonCancel.Text = _languageGeneral.Cancel; labelTip.Text = _language.Tip; UiUtil.FixLargeFonts(this, buttonCancel); var arr = Configuration.Settings.Tools.VisualSyncStartSize?.Split(';'); if (arr != null && arr.Length == 2 && int.TryParse(arr[0], out var x) && int.TryParse(arr[1], out var y)) { var bounds = Screen.FromControl(parentControl).Bounds; if (x >= MinimumSize.Width && x < bounds.Width && y > MinimumSize.Height && y < bounds.Height) { Width = x; Height = y; } } _timerHideSyncLabel.Tick += timerHideSyncLabel_Tick; _timerHideSyncLabel.Interval = 1000; }
public VisualSync() { UiUtil.PreInitialize(this); InitializeComponent(); UiUtil.FixFonts(this); openFileDialog1.InitialDirectory = string.Empty; MediaPlayerStart.InitializeVolume(Configuration.Settings.General.VideoPlayerDefaultVolume); MediaPlayerEnd.InitializeVolume(Configuration.Settings.General.VideoPlayerDefaultVolume); labelSyncDone.Text = string.Empty; _language = Configuration.Settings.Language.VisualSync; _languageGeneral = Configuration.Settings.Language.General; Text = _language.Title; buttonOpenMovie.Text = _languageGeneral.OpenVideoFile; groupBoxMovieInfo.Text = _languageGeneral.VideoInformation; labelVideoInfo.Text = _languageGeneral.NoVideoLoaded; groupBoxStartScene.Text = _language.StartScene; groupBoxEndScene.Text = _language.EndScene; buttonStartThreeSecondsBack.Text = _language.ThreeSecondsBack; buttonThreeSecondsBack.Text = _language.ThreeSecondsBack; buttonStartHalfASecondBack.Text = _language.HalfASecondBack; buttonEndHalfASecondBack.Text = _language.HalfASecondBack; buttonStartVerify.Text = string.Format(_language.PlayXSecondsAndBack, Configuration.Settings.Tools.VerifyPlaySeconds); buttonEndVerify.Text = buttonStartVerify.Text; buttonGotoStartSubtitlePosition.Text = _language.GoToSubPosition; buttonGotoEndSubtitlePosition.Text = _language.GoToSubPosition; buttonFindTextStart.Text = _language.FindText; buttonFindTextEnd.Text = _language.FindText; buttonSync.Text = _language.Synchronize; buttonOK.Text = _languageGeneral.Ok; buttonCancel.Text = _languageGeneral.Cancel; labelTip.Text = _language.Tip; UiUtil.FixLargeFonts(this, buttonCancel); _timerHideSyncLabel.Tick += timerHideSyncLabel_Tick; _timerHideSyncLabel.Interval = 1000; }