Пример #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);
        }
Пример #2
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);
        }