void SetStatistical(Data.ShowData SD, TimeSpan TotalTime, TimeSpan ThisTime, TimeSpan FishTime, bool DivideByTitle) { if (SD == null) { DivideByTitleTextBlock.Text = null; CatchFishTextBlock.Text = null; ThisTimeTextBlock.Text = null; ThisTotalTimeTextBlock.Text = null; TotalTimeTextBlock.Text = null; ThisPercentTextBlock.Text = null; ThisTotalPercentTextBlock.Text = null; ActionNameTextBlock.Text = null; TitleTextBlock.Text = null; CatchFishTimeTextBlock.Text = null; CatchFishPercentTextBlock.Text = null; return; } DivideByTitleTextBlock.Text = DivideByTitle ? "是" : "否"; CatchFishTextBlock.Text = SD.IsCatchFish ? "是" : "否"; ThisTimeTextBlock.Text = Consts.TimeSpan2String(new TimeSpan(SD.Ticks)); ThisTotalTimeTextBlock.Text = Consts.TimeSpan2String(ThisTime); TotalTimeTextBlock.Text = Consts.TimeSpan2String(TotalTime); ThisPercentTextBlock.Text = (100.0 * SD.Ticks / TotalTime.Ticks).ToString("F3") + "%"; ThisTotalPercentTextBlock.Text = (100.0 * ThisTime.Ticks / TotalTime.Ticks).ToString("F3") + "%"; ActionNameTextBlock.Text = Consts.GetFileName(SD.Action); TitleTextBlock.Text = SD.Title; CatchFishTimeTextBlock.Text = Consts.TimeSpan2String(FishTime); CatchFishPercentTextBlock.Text = (100.0 * FishTime.Ticks / TotalTime.Ticks).ToString("F3") + "%"; }
public ListStackPanelItem(Data.ShowData SD) { InitializeComponent(); IconImage.Source = Consts.ChangeBitmapToImageSource(SD.I.ToBitmap()); StartTimeTextBlock.Text = "开始时间:" + SD.Start.ToString(Consts.DateTimeFormatString); EndTimeTextBlock.Text = "结束时间:" + SD.End.ToString(Consts.DateTimeFormatString); ActionTextBlock.Text = Consts.GetFileName(SD.Action); FullFileName = SD.Action; TitleTextBlock.Text = SD.Title; }