本文整理汇总了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");
}