Click here to Skip to main content
15,902,189 members
Home / Discussions / C#
   

C#

 
AnswerRe: Word Doc Link Pin
thunderbirdje21-Aug-06 3:02
thunderbirdje21-Aug-06 3:02 
GeneralRe: Word Doc Link Pin
mlebrock21-Aug-06 3:27
mlebrock21-Aug-06 3:27 
QuestionReduce the width of datagrid colum?? Pin
sikandarhayat21-Aug-06 0:20
sikandarhayat21-Aug-06 0:20 
AnswerRe: Reduce the width of datagrid colum?? Pin
fmardani21-Aug-06 3:14
fmardani21-Aug-06 3:14 
QuestionFind Row in Datagrid Pin
freshonlineMax21-Aug-06 0:13
freshonlineMax21-Aug-06 0:13 
AnswerRe: Find Row in Datagrid Pin
MHASSANF21-Aug-06 0:30
MHASSANF21-Aug-06 0:30 
AnswerRe: Find Row in Datagrid Pin
sikandarhayat21-Aug-06 0:33
sikandarhayat21-Aug-06 0:33 
AnswerRe: Find Row in Datagrid Pin
sikandarhayat21-Aug-06 0:40
sikandarhayat21-Aug-06 0:40 
QuestionAssiging name to label dynamic way ??? Pin
sikandarhayat20-Aug-06 23:58
sikandarhayat20-Aug-06 23:58 
AnswerRe: Assiging name to label dynamic way ??? Pin
Christian Graus21-Aug-06 0:20
protectorChristian Graus21-Aug-06 0:20 
AnswerRe: Assiging name to label dynamic way ??? Pin
freshonlineMax21-Aug-06 0:26
freshonlineMax21-Aug-06 0:26 
GeneralRe: Assiging name to label dynamic way ??? Pin
sikandarhayat21-Aug-06 0:48
sikandarhayat21-Aug-06 0:48 
Questioneigen value of an image Pin
vickyProgrammer20-Aug-06 23:57
vickyProgrammer20-Aug-06 23:57 
GeneralRe: eigen value of an image Pin
Guffa21-Aug-06 0:15
Guffa21-Aug-06 0:15 
GeneralRe: eigen value of an image Pin
vickyProgrammer21-Aug-06 0:47
vickyProgrammer21-Aug-06 0:47 
GeneralRe: eigen value of an image Pin
Colin Angus Mackay21-Aug-06 1:07
Colin Angus Mackay21-Aug-06 1:07 
Questioninsert into database Pin
btota20-Aug-06 23:22
btota20-Aug-06 23:22 
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

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.