Example #1
0
        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);
        }
Example #2
0
        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));
        }
Example #3
0
        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);
        }
Example #4
0
 public void UnregisterElementHandler(ITypeBasedHandler elementHandler, Type type)
 {
     TypeBasedHandlerExtendable.UnregisterElementHandler(elementHandler, type);
 }
Example #5
0
 public virtual void UnregisterElementHandler(ITypeBasedHandler elementHandler, Type type)
 {
     typeToElementHandlers.Unregister(elementHandler, type);
 }
Example #6
0
 public void RegisterElementHandler(ITypeBasedHandler elementHandler, Type type)
 {
     typeToElementHandlers.Register(elementHandler, type);
 }