Click here to Skip to main content
15,894,896 members
Home / Discussions / C#
   

C#

 
AnswerRe: Plant Database Pin
PIEBALDconsult10-Jan-10 10:48
mvePIEBALDconsult10-Jan-10 10:48 
QuestionC# treeview [modified] <code>I my Self Solved it </code> Pin
jojoba20109-Jan-10 18:23
jojoba20109-Jan-10 18:23 
QuestionNeed a sample C# program using the DDay.Ical library that adds Attendees Pin
Stephan Onisick9-Jan-10 14:31
Stephan Onisick9-Jan-10 14:31 
AnswerRe: Need a sample C# program using the DDay.Ical library that adds Attendees Pin
Chuck O'Toole9-Jan-10 16:11
Chuck O'Toole9-Jan-10 16:11 
QuestionAbout Typed parameters Pin
ika29-Jan-10 10:43
ika29-Jan-10 10:43 
AnswerRe: About Typed parameters Pin
DaveyM699-Jan-10 10:51
professionalDaveyM699-Jan-10 10:51 
AnswerRe: About Typed parameters Pin
harold aptroot9-Jan-10 11:00
harold aptroot9-Jan-10 11:00 
AnswerRe: About Typed parameters Pin
DaveyM699-Jan-10 11:27
professionalDaveyM699-Jan-10 11:27 
If you really need to invoke a generic method you could use something like this:
public static class Test
{
    public static T GenericDecodeData<T>(byte[] data, string encRules)
    {
        // ...
        return default(T);
    }

    public static Type GetDownloadType(int id)
    {
        switch (id)
        {
            case DOWNDIRECT: return typeof(DownDirect);
            case DOWNOTHER: return typeof(DownOther);
            case DOWNHEHE: return typeof(DownHehe);
            default: return null;
        }
    }
    public static object DecodeData(Type type, byte[] data, string encRules)
    {
        MethodInfo methodInfo = typeof(Test).GetMethod("GenericDecodeData").MakeGenericMethod(
            new Type[] { type });
        return methodInfo.Invoke(null, new object[] { data, encRules });
    }
}


Dave

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Why are you using VB6? Do you hate yourself? (Christian Graus)

GeneralRe: About Typed parameters Pin
ika29-Jan-10 12:21
ika29-Jan-10 12:21 
QuestionString.Format Pin
Muammar©9-Jan-10 8:45
Muammar©9-Jan-10 8:45 
AnswerRe: String.Format Pin
Dimitri Witkowski9-Jan-10 8:54
Dimitri Witkowski9-Jan-10 8:54 
AnswerRe: String.Format Pin
Ross Templeton9-Jan-10 15:32
Ross Templeton9-Jan-10 15:32 
GeneralRe: String.Format Pin
Muammar©10-Jan-10 0:20
Muammar©10-Jan-10 0:20 
AnswerRe: String.Format Pin
PIEBALDconsult10-Jan-10 10:55
mvePIEBALDconsult10-Jan-10 10:55 
GeneralRe: String.Format Pin
Muammar©10-Jan-10 23:05
Muammar©10-Jan-10 23:05 
QuestionCant get a Media player control on web application in VS Pin
lvq6849-Jan-10 8:37
lvq6849-Jan-10 8:37 
QuestionChange the size in dataGridView Pin
SajjadZare9-Jan-10 5:03
SajjadZare9-Jan-10 5:03 
AnswerRe: Change the size in dataGridView Pin
Luc Pattyn9-Jan-10 7:08
sitebuilderLuc Pattyn9-Jan-10 7:08 
QuestionC# Override CheckedListBox Pin
ikurtz9-Jan-10 4:58
ikurtz9-Jan-10 4:58 
AnswerRe: C# Override CheckedListBox Pin
Luc Pattyn9-Jan-10 5:09
sitebuilderLuc Pattyn9-Jan-10 5:09 
GeneralRe: C# Override CheckedListBox Pin
ikurtz9-Jan-10 5:15
ikurtz9-Jan-10 5:15 
QuestionBreak Recursive Function Pin
dataminers9-Jan-10 4:54
dataminers9-Jan-10 4:54 
AnswerRe: Break Recursive Function Pin
Luc Pattyn9-Jan-10 5:12
sitebuilderLuc Pattyn9-Jan-10 5:12 
AnswerRe: Break Recursive Function Pin
Nicholas Butler9-Jan-10 5:12
sitebuilderNicholas Butler9-Jan-10 5:12 
AnswerRe: Break Recursive Function Pin
Roger Wright9-Jan-10 21:31
professionalRoger Wright9-Jan-10 21:31 

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.