本文整理汇总了C#中GSM.ShowCallHistory方法的典型用法代码示例。如果您正苦于以下问题:C# GSM.ShowCallHistory方法的具体用法?C# GSM.ShowCallHistory怎么用?C# GSM.ShowCallHistory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GSM
的用法示例。
在下文中一共展示了GSM.ShowCallHistory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main()
{
GSM phone = new GSM("Moto X", "Motorola");
phone.AddCall(DateTime.Now, "0899789987", 500);
phone.AddCall(new DateTime(2013, 2, 16), "0899233987", 350);
phone.AddCall(new DateTime(2013, 2, 12), "0899123456", 58);
phone.AddCall(new DateTime(2013, 2, 13), "0899123456", 58);
phone.AddCall(new DateTime(2013, 2, 14), "0899123456", 69);
phone.AddCall(new DateTime(2013, 2, 14), "0899123456", 69);
Console.WriteLine(phone.ToString());
phone.ShowCallHistory();
phone.CalcPrice(0.37M);
phone.RemoveLongestCall();
phone.CalcPrice(0.37M);
phone.ClearHistory();
phone.ShowCallHistory();
}
示例2: GSMCallHistoryTest
private static void GSMCallHistoryTest()
{
GSM testGSM = new GSM("Nokia", "Telerik - A Progress Company");
testGSM.AddCall("+359873432142", 53);
testGSM.AddCall("+359811432142", 123);
testGSM.AddCall("+359872412142", 41);
testGSM.AddCall("+359833332142", 72);
testGSM.AddCall("+359614432142", 231);
testGSM.ShowCallHistory();
Console.WriteLine("Total call price: " + testGSM.TotalCallPrice());
testGSM.DeleteCall(5);
Console.WriteLine("Longest call was removed.");
Console.WriteLine("Total call price: " + testGSM.TotalCallPrice());
testGSM.ClearCallHistory();
Console.WriteLine("Call history was removed.");
testGSM.ShowCallHistory();
}