本文整理汇总了C#中History.Diff方法的典型用法代码示例。如果您正苦于以下问题:C# History.Diff方法的具体用法?C# History.Diff怎么用?C# History.Diff使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类History
的用法示例。
在下文中一共展示了History.Diff方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisplayData
public void DisplayData(string header, History history)
{
HistoryDiff diff = history.Diff();
displayLabelHeader.Text = header;
displayLabelIncoming.Text = MainClass.FormatSizestr(diff.Empty ? 0 : diff.Current.Received)+"/s";
displayLabelOutgoing.Text = MainClass.FormatSizestr(diff.Empty ? 0 : diff.Current.Sent) + "/s";
double maxr = diff.Empty ? 0 : (diff.OrderByDescending(hdi => hdi.Received)).First().Received;
double maxs = diff.Empty ? 0 : (diff.OrderByDescending(hdi => hdi.Sent)).First().Sent;
string str = "Peak in: "+MainClass.FormatSizestr(maxr)+"/s\n";
str += "Peak out: " + MainClass.FormatSizestr(maxs) + "/s\n\n";
str += "Received: " + MainClass.FormatSizestr(history.Empty ? 0 : history.Current.Received) + "\n";
str += "Sent: " + MainClass.FormatSizestr(history.Empty ? 0 : history.Current.Sent);
displayLabelFooter.Text = str;
Image i = displayImage.Image;
displayImage.Image = Graph.GraphSpeeds(diff, (int)(SCALE*(displayImage.Width - 10)), (int)(SCALE*(displayImage.Height - 10)), Color.LimeGreen, Color.Red, Color.Black, 3);
i.Dispose();
}