本文整理汇总了C#中System.Tuple<T1>.Item1属性的典型用法代码示例。如果您正苦于以下问题:C# Tuple<T1>.Item1属性的具体用法?C# Tuple<T1>.Item1怎么用?C# Tuple<T1>.Item1使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。
在下文中一共展示了Tuple<T1>.Item1属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
//引入命名空间
using System;
using System.Numerics;
public class Example
{
public static void Main()
{
var tuple1 = Tuple.Create(-1.23445e-32);
// Display information about this singleton.
Type tuple1Type = tuple1.GetType();
Console.WriteLine("First 1-Tuple:");
Console.WriteLine(" Type: {0}", tuple1Type.Name);
Console.WriteLine(" Generic Parameter Type: {0}",
tuple1Type.GetGenericArguments()[0]);
Console.WriteLine(" Component Value: {0}", tuple1.Item1);
Console.WriteLine(" Component Value Type: {0}",
tuple1.Item1.GetType().Name);
Console.WriteLine();
var tuple2 = Tuple.Create((BigInteger)1.83789322281780983781356676e103);
// Display information about this singleton.
Type tuple2Type = tuple2.GetType();
Console.WriteLine("Second 1-Tuple:");
Console.WriteLine(" Type: {0}", tuple2Type.Name);
Console.WriteLine(" Generic Parameter Type: {0}",
tuple2Type.GetGenericArguments()[0]);
Console.WriteLine(" Component Value: {0}", tuple2.Item1);
Console.WriteLine(" Component Value Type: {0}",
tuple2.Item1.GetType().Name);
}
}
输出:
First 1-Tuple: Type: Tuple`1 Generic Parameter Type: System.Double Component Value: -1.23445E-32 Component Value Type: Double Second 1-Tuple: Type: Tuple`1 Generic Parameter Type: System.Numerics.BigInteger Component Value: 1.8378932228178098168858909492E+103 Component Value Type: BigInteger