Click here to Skip to main content
15,915,062 members
Home / Discussions / C#
   

C#

 
GeneralRe: Navigation... Pin
lovelylooney14-Jul-05 18:13
lovelylooney14-Jul-05 18:13 
GeneralRe: Navigation... Pin
oleman10814-Jul-05 18:38
oleman10814-Jul-05 18:38 
GeneralRe: Navigation... Pin
lovelylooney14-Jul-05 20:18
lovelylooney14-Jul-05 20:18 
GeneralRe: Navigation... Pin
oleman10815-Jul-05 0:18
oleman10815-Jul-05 0:18 
GeneralRe: Navigation... Pin
Christian Graus17-Jul-05 12:55
protectorChristian Graus17-Jul-05 12:55 
GeneralRe: Navigation... Pin
lovelylooney23-Jul-05 20:16
lovelylooney23-Jul-05 20:16 
GeneralRe: Navigation... Pin
Christian Graus24-Jul-05 12:57
protectorChristian Graus24-Jul-05 12:57 
GeneralPassing generics to non generic classes Pin
David Wengier14-Jul-05 15:25
David Wengier14-Jul-05 15:25 
I have a class that uses generics to have a typesafe DataSource property. I want to pass an instance of this class to a form and have it display the datasource. The code looks something like this:

public class DataSource<ItemType> where ItemType : StatefulObjectBase
{
    public ItemType DataSource
    { 
    ....
    }

    public void Show()
    {
        DisplayForm f = new DisplayForm(this);
    }
}


The question is, how do I code the parameter on the forms constructor. Using DataSource<StatefulObjectBase> doesnt work, even though the compiler should know that whatever is in the object is convertible to that type. Even using object didnt work.

All I want to do from the form is access some methods from my generic object. I dont care what type they are.

Any help would be much appreciated.

EDIT: oops, fixing generics.. damn less than and great thans
--
Dave
GeneralRe: Passing generics to non generic classes Pin
Werdna15-Jul-05 6:55
Werdna15-Jul-05 6:55 
GeneralLoading Sound Help Pin
Member 167611414-Jul-05 13:16
Member 167611414-Jul-05 13:16 
GeneralRe: Loading Sound Help Pin
Christian Graus14-Jul-05 13:37
protectorChristian Graus14-Jul-05 13:37 
GeneralRe: Loading Sound Help Pin
14-Jul-05 15:15
suss14-Jul-05 15:15 
GeneralRe: Loading Sound Help Pin
Christian Graus14-Jul-05 15:19
protectorChristian Graus14-Jul-05 15:19 
GeneralRe: Loading Sound Help Pin
14-Jul-05 15:55
suss14-Jul-05 15:55 
GeneralRe: Loading Sound Help Pin
Christian Graus14-Jul-05 16:04
protectorChristian Graus14-Jul-05 16:04 
Generalauto-resizing componets Pin
Sasuko14-Jul-05 13:09
Sasuko14-Jul-05 13:09 
GeneralRe: auto-resizing componets Pin
Dan Neely15-Jul-05 2:22
Dan Neely15-Jul-05 2:22 
GeneralWindows Forms Pin
quiquex14-Jul-05 11:23
quiquex14-Jul-05 11:23 
GeneralRe: Windows Forms Pin
DavidNohejl14-Jul-05 12:10
DavidNohejl14-Jul-05 12:10 
GeneralRe: Windows Forms Pin
Ming_Lei14-Jul-05 12:24
Ming_Lei14-Jul-05 12:24 
GeneralRe: Windows Forms Pin
quiquex14-Jul-05 13:05
quiquex14-Jul-05 13:05 
GeneralRe: Windows Forms Pin
Joshua Nussbaum14-Jul-05 13:36
Joshua Nussbaum14-Jul-05 13:36 
GeneralRe: Windows Forms Pin
quiquex14-Jul-05 19:04
quiquex14-Jul-05 19:04 
GeneralRe: Windows Forms Pin
Dave Kreskowiak15-Jul-05 1:47
mveDave Kreskowiak15-Jul-05 1:47 
GeneralRe: Windows Forms Pin
Anonymous15-Jul-05 5:01
Anonymous15-Jul-05 5:01 

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.