DCSIMG
CLR - Gady Elkarif's Blog

Gady Elkarif's Blog

Browse by Tags

All Tags » CLR (RSS)
Serializable CollectionBase Class
Serializable CollectionBase Class The idea of class CollectionBase is to have a base class which is based on list for serialization, and also on dictionary for fast retrieval. So I have tried to create class CollectionBase class which is serializable, and when I try to serialize it with XmlSerializable , I got the following runtime exception: "To be XML serializable, types which inherit from IEnumerable must have an implementation of Add(System.Object) at all levels of their inheritance hierarchy...
Posted: Aug 18 2008, 04:36 AM by egady | with no comments
תגים:,
User Defined Exception Class
User Defined Exception Class Let's say you want to define Serializable Exception-Derived type MyException , and you want it to inherits from class exception. The following class sameple show how to derived new serializable class from class Exception: [ Serializable ] // Making your exception serializable public class MyException : Exception , ISerializable { private String m_errorId; public String ErrorId { get { return m_errorId; } } public override String Message { get { if (m_errorId == null...
Posted: Apr 29 2008, 05:16 PM by egady | with no comments
תגים:,