public override object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value == null) { return(TimeFormatUtil.INVALID_HHMMSS); } return(TimeFormatUtil.GetHHMMSSOrMMSSPrecision((double)value, true)); }
private static void saveAsSRT(StreamWriter streamWriter, Video video, Subtitle subtitle) { for (int i = 0; i < subtitle.Items.Count; i++) { var item = subtitle.Items[i]; streamWriter.WriteLine(i); streamWriter.WriteLine("{0} --> {1}", TimeFormatUtil.GetHHMMSSOrMMSSPrecision(item.StartSeconds, item.IsOneHourExcessed), TimeFormatUtil.GetHHMMSSOrMMSSPrecision(item.StartSeconds + item.DurationSeconds, item.IsOneHourExcessed)); streamWriter.WriteLine(subtitle.Items[i].Text); streamWriter.WriteLine(); } }
public async void Execute(object parameter) { var item = parameter as BookmarkItem; if (item == null) { return; } var msg = new RemoveBookmarkDialog(); msg.Title = item.Memo; if (msg.Title.Length > 10) { msg.Title = item.Memo.Substring(0, 10) + "..."; } msg.Message = string.Format("시간: {0}\n\n이 북마크를 삭제합니까?", TimeFormatUtil.GetHHMMSSOrMMSSPrecision(item.Seconds, true)); if ((bool)await DialogHost.Show(msg, "BookmarkDialog")) { MainWindowViewModel.TargetVideo.BookmarkTray.RemoveItem(item); } }