private void AddParameters(XElement elem, PropertyValidatorParameterDescriptorCollection target)
 {
     foreach (var item in elem.Elements("parameter"))
     {
         target.Add(new PropertyValidatorParameterDescriptor(item.Attribute("paraName").Value, (PropertyDataType)Enum.Parse(typeof(PropertyDataType), item.Attribute("dataType").Value), item.Attribute("paraValue").Value));
     }
 }
        internal static PropertyValidatorParameterDescriptorCollection PreparePropertyValidatorParametDescriptorCollection()
        {
            PropertyValidatorParameterDescriptorCollection pvpdCollection = new PropertyValidatorParameterDescriptorCollection();

            pvpdCollection.Add(PreparePropertyValidatorParameterIntegerDescriptor());
            pvpdCollection.Add(PreparePropertyValidatorParameterDateTimeDescriptor());

            return(pvpdCollection);
        }
		internal static PropertyValidatorParameterDescriptorCollection PreparePropertyValidatorParametDescriptorCollection()
		{
			PropertyValidatorParameterDescriptorCollection pvpdCollection = new PropertyValidatorParameterDescriptorCollection();

			pvpdCollection.Add(PreparePropertyValidatorParameterIntegerDescriptor());
			pvpdCollection.Add(PreparePropertyValidatorParameterDateTimeDescriptor());

			return pvpdCollection;
		}
        public void PropertyValidatorParameterDescriptorCollectionSerializeTest()
        {
            PropertyValidatorParameterDescriptorCollection pvpdCollection = PreparePropertyValidatorParametDescriptorCollection();

            XElementFormatter formatter = new XElementFormatter();

            XElement root = formatter.Serialize(pvpdCollection);

            Console.WriteLine(root.ToString());

            PropertyValidatorParameterDescriptorCollection newCollection = (PropertyValidatorParameterDescriptorCollection)formatter.Deserialize(root);

            XElement rootReserialized = formatter.Serialize(newCollection);

            Assert.AreEqual(root.ToString(), rootReserialized.ToString());
            Assert.AreEqual(pvpdCollection.Count, newCollection.Count);
        }