Click here to Skip to main content
15,888,454 members
Home / Discussions / C#
   

C#

 
AnswerRe: insert into database Pin
Colin Angus Mackay20-Aug-06 23:36
Colin Angus Mackay20-Aug-06 23:36 
QuestionReg Infragistics tool Pin
Uma Kameswari20-Aug-06 23:16
Uma Kameswari20-Aug-06 23:16 
AnswerRe: Reg Infragistics tool Pin
Christian Graus20-Aug-06 23:18
protectorChristian Graus20-Aug-06 23:18 
QuestionGridview Rows Pin
Brendan Vogt20-Aug-06 23:08
Brendan Vogt20-Aug-06 23:08 
QuestionProblems Setting up a Form that Emails Tasks [modified] Pin
Jag7720-Aug-06 22:26
Jag7720-Aug-06 22:26 
AnswerRe: Problems Setting up a Form that Emails Tasks Pin
Christian Graus20-Aug-06 23:17
protectorChristian Graus20-Aug-06 23:17 
GeneralRe: Problems Setting up a Form that Emails Tasks Pin
gnjunge20-Aug-06 23:30
gnjunge20-Aug-06 23:30 
QuestionXML Serialize / Deserialize generic dictionary holding various generic types Pin
Florian Storck20-Aug-06 21:52
Florian Storck20-Aug-06 21:52 
Hi,

I'm kind of stuck with an serializing / deserializing problem using a generic dictionary holding references to various generic types. It goes as follows:

<br />
<br />
class MyBase : IXmlSerializable<br />
{<br />
 // whatever<br />
}<br />
<br />
class MyGeneric<ValueType> : MyBase, IXmlSerializable<br />
{<br />
   MyGeneric(Valuetype tVal)<br />
   {<br />
     val = tVal;<br />
   }<br />
   ValueType val;<br />
}<br />
<br />
class Program<br />
{<br />
   dictionary<string, MyBase> m_Dic = new dictionary<string,MyBase>();<br />
<br />
   void FillDictionary()<br />
   {<br />
      dictionary.Add("Key1", new MyGeneric<int>(10));<br />
      dictionary.Add("Key1", new MyGeneric<string>("StringValue"));<br />
      dictionary.Add("Key1", new MyGeneric<double>(3.1415));<br />
   }<br />
}<br />


Ok, I hope you can see the idea behind it. It's mainly thought to hold a variety of different types whithout specifying a parameter enum which selects the appropiate value via a huge switch statement on lots of overloads to the value Get/Set property.

While I'm able to serialize the dictionary without a problem to an XML file, I'm stuck deserializing it.

The problem: how can I can generate a generic from a textinformation like

<mygenericofint32> or MyApp.MyGeneric`1[System.String] ?

The first classification is generated by the .Net serializer and the second is generated from typeof(...) .

Any ideas are very appreciated.

Thanks,
Florian
AnswerRe: XML Serialize / Deserialize generic dictionary holding various generic types Pin
Florian Storck21-Aug-06 2:50
Florian Storck21-Aug-06 2:50 
QuestionRunning program Pin
drc_no120-Aug-06 21:19
drc_no120-Aug-06 21:19 
AnswerRe: Running program Pin
stancrm20-Aug-06 22:11
stancrm20-Aug-06 22:11 
Questiontree view is not displyed Pin
ayyp20-Aug-06 21:07
ayyp20-Aug-06 21:07 
Questionimplement Download functionality in windows based Application project Pin
joy_priyank20-Aug-06 19:47
joy_priyank20-Aug-06 19:47 
AnswerRe: implement Download functionality in windows based Application project Pin
Nader Elshehabi21-Aug-06 2:28
Nader Elshehabi21-Aug-06 2:28 
GeneralRe: implement Download functionality in windows based Application project Pin
joy_priyank22-Aug-06 0:00
joy_priyank22-Aug-06 0:00 
GeneralRe: implement Download functionality in windows based Application project Pin
Nader Elshehabi22-Aug-06 3:41
Nader Elshehabi22-Aug-06 3:41 
Questionoutlook context menu Error and PREVIEW PANE Problem Pin
K edar V20-Aug-06 19:44
K edar V20-Aug-06 19:44 
AnswerRe: outlook context menu Error and PREVIEW PANE Problem Pin
Nader Elshehabi21-Aug-06 2:07
Nader Elshehabi21-Aug-06 2:07 
GeneralRe: outlook context menu Error and PREVIEW PANE Problem Pin
K edar V21-Aug-06 2:15
K edar V21-Aug-06 2:15 
GeneralRe: outlook context menu Error and PREVIEW PANE Problem Pin
Nader Elshehabi21-Aug-06 3:03
Nader Elshehabi21-Aug-06 3:03 
QuestionDataGrid with Check Boxes Pin
Pinnapureddy20-Aug-06 19:39
Pinnapureddy20-Aug-06 19:39 
AnswerRe: DataGrid with Check Boxes Pin
Nader Elshehabi21-Aug-06 1:57
Nader Elshehabi21-Aug-06 1:57 
GeneralRe: DataGrid with Check Boxes Pin
Pinnapureddy21-Aug-06 21:44
Pinnapureddy21-Aug-06 21:44 
QuestionCrystal Reports and filling dataset/datatable Pin
Glen Harvy20-Aug-06 19:14
Glen Harvy20-Aug-06 19:14 
Questionstartup times woes.... Pin
Super Lloyd20-Aug-06 14:10
Super Lloyd20-Aug-06 14:10 

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.