Click here to Skip to main content
15,891,864 members
Home / Discussions / C#
   

C#

 
AnswerRe: About Reflecting and generics Pin
Luc Pattyn14-Feb-12 12:41
sitebuilderLuc Pattyn14-Feb-12 12:41 
RantRe: About Reflecting and generics Pin
PozzaVecia14-Feb-12 12:58
PozzaVecia14-Feb-12 12:58 
GeneralRe: About Reflecting and generics Pin
GParkings14-Feb-12 23:44
GParkings14-Feb-12 23:44 
GeneralRe: About Reflecting and generics Pin
PozzaVecia15-Feb-12 0:10
PozzaVecia15-Feb-12 0:10 
GeneralRe: About Reflecting and generics Pin
GParkings15-Feb-12 0:59
GParkings15-Feb-12 0:59 
GeneralRe: About Reflecting and generics Pin
jschell14-Feb-12 13:40
jschell14-Feb-12 13:40 
AnswerRe: About Reflecting and generics Pin
AspDotNetDev14-Feb-12 13:00
protectorAspDotNetDev14-Feb-12 13:00 
GeneralRe: About Reflecting and generics Pin
PozzaVecia14-Feb-12 21:20
PozzaVecia14-Feb-12 21:20 
I try to make a more precise example


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestGeneric
{
    class Program
    {
        static void Main(string[] args)
        {
            //these must be string since they come from a spreadsheet
            string myKeyType = "string";
            string myValueType = "double";

            //I should inizialize  myClass
            
#region From Here I heve problem...
            Type d1 = typeof(myClass<,>);
            
            // dictionary is Example.
            Type[] typeArgs = { typeof(Type.GetType(myKeyType)), typeof(Type.GetType(myValueype)) }; //Howw to do it??

           
            Type constructed = d1.MakeGenericType(typeArgs);
            //I  need to have myClass<string, double>.. 

#endregion  
        }
    }

    //dummy class for example.. It is only example to show it must have two generics
    public class myClass<T, G>
    {
        Dictionary<T, G> mD;
        public myClass()
        {
            mD = new Dictionary<T, G>();
        
        }
    }

}

AnswerRe: About Reflecting and generics Pin
AspDotNetDev14-Feb-12 21:49
protectorAspDotNetDev14-Feb-12 21:49 
GeneralRe: About Reflecting and generics Pin
PozzaVecia14-Feb-12 22:26
PozzaVecia14-Feb-12 22:26 
GeneralRe: About Reflecting and generics Pin
AspDotNetDev15-Feb-12 7:09
protectorAspDotNetDev15-Feb-12 7:09 
GeneralRe: About Reflecting and generics Pin
AspDotNetDev14-Feb-12 21:52
protectorAspDotNetDev14-Feb-12 21:52 
AnswerRe: About Reflecting and generics Pin
BobJanova14-Feb-12 23:20
BobJanova14-Feb-12 23:20 
GeneralRe: About Reflecting and generics Pin
PozzaVecia14-Feb-12 23:29
PozzaVecia14-Feb-12 23:29 
GeneralRe: About Reflecting and generics Pin
BobJanova15-Feb-12 0:50
BobJanova15-Feb-12 0:50 
GeneralRe: About Reflecting and generics Pin
PozzaVecia15-Feb-12 1:24
PozzaVecia15-Feb-12 1:24 
GeneralRe: About Reflecting and generics Pin
BobJanova15-Feb-12 1:59
BobJanova15-Feb-12 1:59 
GeneralRe: About Reflecting and generics Pin
PozzaVecia15-Feb-12 2:30
PozzaVecia15-Feb-12 2:30 
GeneralRe: About Reflecting and generics Pin
BobJanova15-Feb-12 2:37
BobJanova15-Feb-12 2:37 
GeneralRe: About Reflecting and generics Pin
GParkings15-Feb-12 2:52
GParkings15-Feb-12 2:52 
GeneralRe: About Reflecting and generics Pin
GParkings15-Feb-12 2:54
GParkings15-Feb-12 2:54 
GeneralRe: About Reflecting and generics Pin
PozzaVecia15-Feb-12 3:09
PozzaVecia15-Feb-12 3:09 
GeneralRe: About Reflecting and generics Pin
GParkings15-Feb-12 3:25
GParkings15-Feb-12 3:25 
GeneralRe: About Reflecting and generics Pin
BobJanova15-Feb-12 3:40
BobJanova15-Feb-12 3:40 
GeneralRe: About Reflecting and generics Pin
PozzaVecia15-Feb-12 10:17
PozzaVecia15-Feb-12 10:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.