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


C# Tuple.GetType方法代码示例

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


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

示例1: DynamicCreateLongTypedTuple

        public void DynamicCreateLongTypedTuple()
        {
            object tup = Tupler.Create(1, "2", "3", 4,
                    5, 6, 7, "8", "9", 10, "11", 12);

            var tup2 = new Tuple<int, string, string, int, int, int, int, Tuple<string, string, int, string, int>>(
                1, "2", "3", 4,
                5, 6, 7, Tuple.Create("8", "9", 10, "11", 12)
                );

            Assert.That(tup, Is.TypeOf(tup2.GetType()));

            Assert.That(tup, Is.EqualTo(tup2));
        }
开发者ID:ekonbenefits,项目名称:dynamitey,代码行数:14,代码来源:TuplerTest.cs

示例2: Main

        public static void Main(string[] args)
        {
            // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2014/201408/20140809/linq-jvm
            // X:\jsc.svn\examples\java\Test\TestNewArrayGenericImport\TestNewArrayGenericImport\Class1.cs


            // X:\jsc.svn\examples\java\Test\TestLocalGenericArgumentReference\TestLocalGenericArgumentReference\Class1.cs

            System.Console.WriteLine(
   typeof(object).AssemblyQualifiedName
);


            var z = new Tuple<MemberInfo, int>[] {
                // Tuple.Create(item.m, index)
            };

            Console.WriteLine(z.GetType().FullName);

            CLRProgram.CLRMain();
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:21,代码来源:Program.cs

示例3: TupleCollection2

 public void TupleCollection2()
 {
     var value = new Tuple<Int32,String,Boolean> (1, "jeb", false);
     var data = "0a01010a04036a65620a0100";
     var encodeResult = Encoder.Encode (value, value.GetType ());
     Assert.AreEqual (data, Hexlify (encodeResult));
     Tuple<Int32,String,Boolean> decodeResult = (Tuple<Int32,String,Boolean>)Encoder.Decode (Unhexlify (data), value.GetType (), null);
     Assert.AreEqual (value, decodeResult);
 }
开发者ID:artwhaley,项目名称:krpc,代码行数:9,代码来源:EncoderTest.cs

示例4: TupleCollection1

 public void TupleCollection1()
 {
     var value = new Tuple<Int32> (1);
     var data = "0a0101";
     var encodeResult = Encoder.Encode (value, value.GetType ());
     Assert.AreEqual (data, Hexlify (encodeResult));
     Tuple<Int32> decodeResult = (Tuple<Int32>)Encoder.Decode (Unhexlify (data), value.GetType (), null);
     Assert.AreEqual (value, decodeResult);
 }
开发者ID:artwhaley,项目名称:krpc,代码行数:9,代码来源:EncoderTest.cs

示例5: TupleCollection2

 public void TupleCollection2 ()
 {
     var value = new Tuple<int,string,bool> (1, "jeb", false);
     const string data = "0a01010a04036a65620a0100";
     var encodeResult = Encoder.Encode (value, value.GetType ());
     Assert.AreEqual (data, encodeResult.ToHexString ());
     var decodeResult = (Tuple<int,string,bool>)Encoder.Decode (data.ToByteString (), value.GetType (), null);
     Assert.AreEqual (value, decodeResult);
 }
开发者ID:paperclip,项目名称:krpc,代码行数:9,代码来源:EncoderTest.cs

示例6: TupleCollection1

 public void TupleCollection1 ()
 {
     var value = new Tuple<int> (1);
     const string data = "0a0101";
     var encodeResult = Encoder.Encode (value, value.GetType ());
     Assert.AreEqual (data, encodeResult.ToHexString ());
     var decodeResult = (Tuple<int>)Encoder.Decode (data.ToByteString (), value.GetType (), null);
     Assert.AreEqual (value, decodeResult);
 }
开发者ID:paperclip,项目名称:krpc,代码行数:9,代码来源:EncoderTest.cs

示例7: MethodCallTestMethod

 private static int MethodCallTestMethod(int arg)
 {
     var a = new Tuple<int, int>(arg, -arg);
     return a.GetType().GetHashCode();
 }
开发者ID:krauthaufen,项目名称:CSharpQuotations,代码行数:5,代码来源:ExpressionCompilerTest.cs

示例8: TupleKeyInfoHelper_KeyMemberSelectorLarge2

        public void TupleKeyInfoHelper_KeyMemberSelectorLarge2()
        {
            var tuple = 
                new Tuple<int, int, int, int, int, int, int, 
                    Tuple<int, int, int, int, int, int, int, 
                        Tuple<int, int>>>(
                1, 2, 3, 4, 5, 6, 7, 
                    new Tuple<int, int, int, int, int, int, int, Tuple<int, int>>(
                        8, 9, 10, 11, 12, 13, 14, Tuple.Create(15, 16)));

            TupleKeyInfoHelper builder = new TupleKeyInfoHelper(tuple.GetType());

            Expression source = Expression.Constant(tuple);
            Expression selector = builder.CreateKeyMemberSelectorExpression(source, 15);

            int result = (int)Expression.Lambda(selector).Compile().DynamicInvoke();

            Assert.AreEqual(16, result);
        }
开发者ID:CedricDumont,项目名称:NMemory.Next,代码行数:19,代码来源:KeyInfoHelperFixture.cs


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