protected virtual void WriteObjectContent(Object obj, Type type, IWriter writer) { ITypeBasedHandler extension = typeToElementHandlers.GetExtension(type); if (extension == null) { throw new Exception("No extension mapped to type '" + type.Name + "' found"); } extension.WriteObject(obj, type, writer); }
protected virtual Object ReadObjectContent(Type returnType, Type type, int id, IReader reader) { ITypeBasedHandler extension = typeToElementHandlers.GetExtension(type); if (extension == null) { throw new Exception("No extension mapped to type '" + type.Name + "' found"); } return(extension.ReadObject(returnType, type, id, reader)); }
public void WriteObject(Object obj, IWriter writer) { Type type = ProxyHelper.GetRealType(obj.GetType()); ITypeBasedHandler extension = typeToElementHandlers.GetExtension(type); if (extension == null) { throw new ArgumentException("Could not write object: " + obj); } extension.WriteObject(obj, type, writer); }
public void UnregisterElementHandler(ITypeBasedHandler elementHandler, Type type) { TypeBasedHandlerExtendable.UnregisterElementHandler(elementHandler, type); }
public virtual void UnregisterElementHandler(ITypeBasedHandler elementHandler, Type type) { typeToElementHandlers.Unregister(elementHandler, type); }
public void RegisterElementHandler(ITypeBasedHandler elementHandler, Type type) { typeToElementHandlers.Register(elementHandler, type); }