本文整理汇总了C#中GSM.DeleteCalls方法的典型用法代码示例。如果您正苦于以下问题:C# GSM.DeleteCalls方法的具体用法?C# GSM.DeleteCalls怎么用?C# GSM.DeleteCalls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GSM
的用法示例。
在下文中一共展示了GSM.DeleteCalls方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
//test the call history functionality
static void Main()
{
//Create a new mobile phone
GSM mobile = new GSM("Xperia", "Sony", 670.99, "Kitty");
//Get information about created mobile phone
mobile.ToString();
//Get information about static field iPhone
GSM.IPhone4S.ToString();
//Add calls and print
mobile.AddCalls(DateTime.Now, "+359 885 440 340", 1);
mobile.AddCalls(DateTime.Now, "+359 886 789 451", 94);
mobile.PrintCalls();
//Delete call and print
mobile.DeleteCalls(2);
mobile.PrintCalls();
//Calculate total price
mobile.CalculateFinalPrice(0.35);
//Clear calls and print
mobile.ClearCalls();
}
示例2: Main
static void Main()
{
DateTime date1 = new DateTime(2013, 5, 24, 11, 11, 30);
DateTime date2 = new DateTime(2013, 5, 24, 15, 23, 2);
DateTime date3 = new DateTime(2013, 5, 31, 9, 00, 00);
DateTime date4 = new DateTime(2013, 5, 31, 18, 12, 20);
Call call1 = new Call(date1, "0888313233", 850);
Call call2 = new Call(date2, "0888909090", 95);
Call call3 = new Call(date3, "0889556677", 213);
Call call4 = new Call(date4, "0888313233", 37);
Battery battery = new Battery ("PX8", BatteryType.LiIon, 300, 8);
Display display = new Display(4, 16000000);
GSM gsm = new GSM("I900", "Samsung", 500, "Me", battery, display);
gsm.AddCalls(call1);
gsm.AddCalls(call2);
gsm.AddCalls(call3);
gsm.AddCalls(call4);
foreach (var call in gsm.CallHistory)
{
Console.WriteLine(call);
}
Console.WriteLine("Total amount to pay: {0:C}",gsm.TotalCallsPrice);
gsm.DeleteCalls(call1);
Console.WriteLine("Total amount to pay: {0:C}", gsm.TotalCallsPrice);
gsm.ClearHistory();
Console.WriteLine("Total amount to pay: {0:C}", gsm.TotalCallsPrice);
}
示例3: Main
static void Main()
{
GSM testPhone = new GSM("L6", "Motorola");
testPhone.AddCalls(DateTime.Now, "0879454532", 62);
testPhone.AddCalls(DateTime.Now, "8787878789", 500);
testPhone.AddCalls(DateTime.Now, "4545454545", 420);
testPhone.AddCalls(DateTime.Now, "1111111111", 100);
testPhone.DisplayCallInformation();
double finalPrice = testPhone.CalculatePrice(0.37);
Console.WriteLine("This is the price for all the calls");
Console.WriteLine(finalPrice);
testPhone.DeleteCalls(500);
double priceAfterRemoval = testPhone.CalculatePrice(0.37);
Console.WriteLine("This is the price without the longest call:");
Console.WriteLine(priceAfterRemoval);
testPhone.ClearingHistory();
testPhone.DisplayCallInformation();
}