当前位置: 首页>>代码示例>>C#>>正文


C# GSM.Bill方法代码示例

本文整理汇总了C#中GSM.Bill方法的典型用法代码示例。如果您正苦于以下问题:C# GSM.Bill方法的具体用法?C# GSM.Bill怎么用?C# GSM.Bill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GSM的用法示例。


在下文中一共展示了GSM.Bill方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StartTest

    public static void StartTest()
    {
        var display = new Display(3, 300);
        var battery = new Battery("S.NO.W3TT543");
        GSM addPhone = new GSM("Hero", "HTC", 100m, "4ovek", battery, display);

        DateTime time = new DateTime(2013, 1, 10, 11, 00, 00);
        string number = "08837656282";
        int duration = 60;
        addPhone.AddCall(time, number, duration);

        DateTime time1 = new DateTime(2013, 1, 10, 12, 00, 00);
        string number1 = "08957656282";
        int duration1 = 135;
        addPhone.AddCall(time1, number1, duration1);

        DateTime time2 = new DateTime(2013, 1, 10, 12, 05, 00);
        string number2 = "08957656282";
        int duration2 = 35;
        addPhone.AddCall(time2, number2, duration2);

        var callHistory = addPhone.CallHistory;
        Console.WriteLine();
        foreach (var call in callHistory)
        {
            Console.WriteLine("Call: {0}\t{1}\t{2} secconds", call.Phone, call.Time, call.Duration);
        }

        Console.WriteLine("The bill is: {0}$", addPhone.Bill(0.37m));

        callHistory = callHistory.OrderByDescending(x => x.Duration).ToList();
        addPhone.DelCall(callHistory[0]);
        Console.WriteLine("After deleting the longest call the bill is: {0}$", addPhone.Bill(0.37m));

        addPhone.ClearCallHistory();
        Console.WriteLine("Printing call history (should be empty)");
        callHistory = addPhone.CallHistory;
        foreach (var call in callHistory)
        {
            Console.WriteLine("Call: {0}\t{1}\t{2} secconds", call.Phone, call.Time, call.Duration);
        }
    }
开发者ID:damy90,项目名称:Telerik-all,代码行数:42,代码来源:GSMCallHistoryTest.cs


注:本文中的GSM.Bill方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。