本文整理汇总了C#中GSM.AddCallToHistory方法的典型用法代码示例。如果您正苦于以下问题:C# GSM.AddCallToHistory方法的具体用法?C# GSM.AddCallToHistory怎么用?C# GSM.AddCallToHistory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GSM
的用法示例。
在下文中一共展示了GSM.AddCallToHistory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
GSM gsm1 = new GSM("Nokia", "Nokia Corp");
GSM gsm2 = new GSM("Apple", "Apple Inc.");
gsm1.Price = 1300;
gsm1.Battery.HoursIdle = 120;
gsm1.Battery.HoursTalk = 12;
gsm1.TypeOfBattery = Battery.BatteryType.NiCd;
gsm1.Battery.Model = "China";
gsm1.Display.NumberOfColors = 16;
gsm1.Display.Size = 4.5;
gsm1.AddCallToHistory("26.2.2013", "12:00", 0887698631, 123);
gsm1.AddCallToHistory("27.2.2013", "12:00", 0887698631, 123);
gsm1.AddCallToHistory("28.2.2013", "12:00", 0887698631, 123);
gsm1.Owner = "Pencho";
Console.WriteLine(gsm1);
Console.WriteLine(gsm1.CallPrice(0.45m));
//GSM gsm2 = GSM.IPhone4S;
//Console.WriteLine(gsm2);
//GSMTest gsm3 = new GSMTest(5);
//foreach (var item in gsm3)
//{
// Console.WriteLine(item);
//}
}
示例2: Main
static void Main()
{
GSM mobile = new GSM("3310", "Nokia");
//Add some calls
mobile.AddCallToHistory(new Call(DateTime.Now.AddDays(3), DateTime.Now.TimeOfDay, "0888123123", 120));
mobile.AddCallToHistory(new Call(DateTime.Now.AddDays(5), DateTime.Now.TimeOfDay, "0888456456", 35));
//Display call history and total price
mobile.DisplayCallHistory();
Console.WriteLine("Total price: {0:F2}", mobile.CalculateTotalPrice(0.37));
Console.WriteLine();
//Remove longest call and display total price again
mobile.RemoveLongestCall();
Console.WriteLine("Total price: {0:F2}", mobile.CalculateTotalPrice(0.37));
Console.WriteLine();
//Clear call history and print it
mobile.ClearCallHistory();
mobile.DisplayCallHistory();
}