コード例 #1
0
        public GenericType()
        {
            nextedType = new NestedGeneric <T>();

            if (typeof(T) == typeof(string) && typeof(T) == typeof(int))
            {
                Console.WriteLine("impossable");
            }
        }
コード例 #2
0
 public async Task RuntimeCodeGenNestedGenericTest()
 {
     const int Expected = 123985;
     var grain = GrainFactory.GetGrain<INestedGenericGrain>(Guid.NewGuid());
     
     var nestedGeneric = new NestedGeneric<int> { Payload = new NestedGeneric<int>.Nested { Value = Expected } };
     var actual = await grain.Do(nestedGeneric);
     Assert.AreEqual(Expected, actual, "NestedGeneric<int>.Nested value should round-trip correctly.");
     
     var nestedConstructedGeneric = new NestedConstructedGeneric
     {
         Payload = new NestedConstructedGeneric.Nested<int> { Value = Expected }
     };
     actual = await grain.Do(nestedConstructedGeneric);
     Assert.AreEqual(Expected, actual, "NestedConstructedGeneric.Nested<int> value should round-trip correctly.");
 }
コード例 #3
0
ファイル: GenericClass.cs プロジェクト: ppittle/LBi.LostDoc
 /// <summary>
 /// Generic method with ref param.
 /// </summary>
 /// <typeparam name="M">The generic</typeparam>
 /// <param name="n">The param</param>
 /// <returns></returns>
 public Boolean TryRefMethodGeneric <M>(ref NestedGeneric <M> n)
 {
     return(false);
 }
コード例 #4
0
 public void MethodWithPartiallyClosedNestedGenericType <T1> (NestedGeneric <T1> p1, NestedGeneric <TType1> p2)
 {
     Dev.Null = p1;
     Dev.Null = p2;
 }
コード例 #5
0
 public void MethodWithNestedGenericType(NestedGeneric <int> p1)
 {
     Dev.Null = p1;
 }