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


C# Call.ToString方法代码示例

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


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

示例1: Main

 static void Main()
 {
     string[] model = { "5S", "Galaxy", "Lumia 1080" };//necesery fields
     string[] manufactory = { "IPhone", "Samsung", "Nokia" };//necesery fields
     List<GSMCoreInfo> GSMs = new List<GSMCoreInfo>();
     //Loop for fill all fields
     for (int i = 0; i < model.Length; i++)
     {
         GSMCoreInfo GSM = new GSMCoreInfo(model[i], manufactory[i]);
         GSMs.Add(GSM);
         Console.WriteLine(GSM.ToString());
     }
     Console.WriteLine(GSMCoreInfo.IPhone);
     //Test the Call class
     List<Call> callPerPhone = new List<Call>();
     string[] callTime = { "2000.12.3;23:11", "2000.12.4;25:23", "2000.12.24;23:59", "2001.1.1;00:01" };
     string[] dialedNumber = { "0877123456", "0877123456", "0877123456", "0877123456" };
     ulong[] durationInSec = { 180, 240, 450, 360 };
     decimal sum = new decimal();
     for (int i = 0; i < 4; i++)
     {
         Call currentCall = new Call();
         currentCall.CallTime = callTime[i];
         currentCall.DialedNumber = dialedNumber[i];
         currentCall.DurationSec = durationInSec[i];
         Console.WriteLine(currentCall.ToString());
         callPerPhone.Add(currentCall);
     }
     //Idont have much time and i write it in Main to compile its prity good timing and fast rewriting
     TotalMoney total = new TotalMoney();
     Console.WriteLine("{0} \n Money spend: "+total.SumAllCalls(callPerPhone),GSMs[2]);
     ulong deffduration = callPerPhone[0].DurationSec;
     for (int i = 0; i <callPerPhone.Count; i++)
     {
         if (deffduration < callPerPhone[i].DurationSec)
         {
             deffduration = callPerPhone[i].DurationSec;
         }
     }
     for (int i = 0; i < callPerPhone.Count; i++)
     {
         if (deffduration == callPerPhone[i].DurationSec)
         {
             callPerPhone[i].DurationSec = 0;
         }
     }
     Console.WriteLine("{0} \n Money spend: " + total.SumAllCalls(callPerPhone), GSMs[2]);
     callPerPhone.Clear();
     Console.WriteLine("This Info is Cleared");
     Console.WriteLine("Have a nice Day");
 }
开发者ID:yavor2000,项目名称:All-HomeWorks-SoftwareUniversity-TelerikAcademy,代码行数:51,代码来源:TestsClasses.cs


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