示例#1
0
 /// <summary>
 /// Constructor of an XmlElement class.
 /// This constructor could throw an XmlBinder.Exception.XmlElementException if parameters are not correct.
 /// </summary>
 /// <param name="_identifier">Name of the xml tag.</param>
 /// <param name="_binder">Binder object to use to bind xml tag.</param>
 public XmlElement(string _identifier, BinderInterface _binder)
 {
     if (_identifier == "")
     {
         throw new XmlElementException("XmlElement", "Constructor", "unable to create an XmlElement without an identifier.");
     }
     if (_binder == null)
     {
         throw new XmlElementException("XmlElement", "Constructor", "unable to create an XmlElement withour a binder.");
     }
     this.Identifier = _identifier;
     this.Binder = _binder;
 }
 /// <summary>
 /// Create a new collection object binder.
 /// </summary>
 /// <param name="_fieldName">The name of the collection field.</param>
 /// <param name="_newType">The type of the object to create.</param>
 /// <param name="_contentBinder">The binder to use to xml content if needed.</param>
 public CollectionObjectBinder(string _fieldName, Type _newType, BinderInterface _contentBinder = null)
     : base(_fieldName)
 {
     m_objectType = _newType;
     m_contentBinder = _contentBinder;
 }
示例#3
0
 /// <summary>
 /// Build a binder with specified class type and content binder.
 /// </summary>
 /// <param name="_fieldName">The field to bind the new object to.</param>
 /// <param name="_classType">The type of the new object.</param>
 /// <param name="_contentBinder">A Binder to bind the content of xml tag if needed.</param>
 public ObjectBinder(string _fieldName, Type _classType, BinderInterface _contentBinder = null)
     : base(_fieldName)
 {
     m_classType = _classType;
     m_contentBinder = _contentBinder;
 }