Click here to Skip to main content
15,904,655 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have a Helper class which is used to import from a csv file.
The import method has a DataHolder template used to implement generic way of importing...
C#
public static CsvImportState ImportFromCsv<TDataHolder>(StreamReader streamReader, out ICsvFile<TDataHolder> csvFile) where TDataHolder : DataHolderBase
       {



I was trying to keep a UI to use this import helper class

My UI will be used by different clients with different Dataholder classes..

For example in my Import button click i need to pass the out parameter
ICsvFile<TDataHolder> csvFile

But in UI how shall i create a template which is similar to TDataHolder in ImportFile helper class.

Please help me.

Thanks in Advance.
Posted
Updated 28-Jun-11 19:56pm
v3

1 solution

Why create another type? I would try to use the exact same TDataHolder type for sender and consumer.

Would that be possible in your situation?
 
Share this answer
 
Comments
arun_pk 29-Jun-11 3:29am    
I tried but i am not able to declare any variable with TDataHolder in my Dialog class
:(
lukeer 6-Jul-11 8:55am    
You could implement the TDataHolder base class in a dll that all of the other projects (sender and consumers) hold a reference to. That way the base class should be usable everywhere you need it to.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900