Re: Generische Liste und serializieren



Hallo Günter,
hab wider unten reingeschrieben
und, nicht zu vergessen
Danke

"Günter Prossliner" <g.prossliner/gmx/at> schrieb im Newsbeitrag
news:%23xXgpJbsHHA.3504@xxxxxxxxxxxxxxxxxxxxxxx
Hallo Peter!

Was für ein Typ is "DataType"? Dessen öffentliche Properties werden
natürlich auch serialisiert. Tritt dort das Problem auf?


DataType ist eben der DataType, also System.String System.Int32 usw.

Was wenn DataType eine Referenz auf komplexes Objekt ist, welches nicht
ohne weiteres Xml-Serialisiert werden kann? Dann wäre es auch möglich z.b.
nur ein eindeutiges Merkmal des DataType - Objektes (z.b. den Namen) zu
speichern, und die eigentliche Instanz bei der Deserialisierung (bzw.
on-demand) zu laden.

z.b:


Das hier werde ich mal versuchen obwohl ich eigentlich auch gut mit
_dataType.ToString() oder der TypeCode.Enum des Typ's leben könnte.

class X{

string _dataTypeName;
DataType _dataType;

[XmlIgnore]
public DataType DataType {
set{
...
_dataTypeName = value.Name;
}

get{
if(_dataType==null){
// create DataType object
}
}
}

// for Xml-Serialization
public string DataTypeName {
get{...}
set{...}
}

}



mfg GP



.



Relevant Pages

  • Help!! Oracle 9.2.0.5.0 wont properly read the *.rsp
    ... #Datatype: String ... #Datatype: Boolean ... #This page shows the current status in the installation. ...
    (comp.databases.oracle.server)
  • Re: GOSUB, the larger picture (was Worldwide known Excellence of GOSUB)
    ... > does not mean that was not a hack. ... Yep, a Byte datatype was indeed needed, and welcome! ... No need to break String, ... It aint bigger Karl, ...
    (microsoft.public.vb.general.discussion)
  • Re: Access Query Right Align
    ... Gary - The DataType is text for all fields. ... Dim hFile As Long ... Dim strPath As String ... Dim strTextLine As String ...
    (microsoft.public.access.queries)
  • Re: Get Data Type
    ... the data types of the resultant columns - similiar to the decisions made by ... If I then needed to find out what datatype these variables were I could use: ... wanted to know if a string represented a positive long integer then I would ...
    (microsoft.public.access.modulesdaovba)
  • Re: converting data to null using DBNull problem
    ... the DBNull Object can only be set to a String type so ... setting the datatype here to other than string type would cause an error. ... It is possible to set the datatype here though and use thte Parse function ...
    (microsoft.public.sqlserver.dts)