public static string GetString(PropertySerializationType serializationType)
 {
     return(_serializationTypesStringMap.GetValue(serializationType));
 }
		void DeterminePropertyType(bool indexer)
		{
			Type t = this.Type;
			bool serializable = Serializer.IsSerializable(t);
			this.elementType = t;

			if (
				 (indexer == false)
				 && (
					  t.IsValueType
					  || (t == typeof(string))
					  || serializable
					  )
				 )
			{
				//  Not a collection or array
			}
			else if (t.IsArray)
			{
				this.elementType = t.GetElementType();
				this.serializationType |= PropertySerializationType.Array;
			}
			else // check for ICollection<> or IDictionary<> or Nullable<>
			{
				if (FindCollectionInterface(
						  t,
						  out this.collectionInterfaceType,
						  out this.dictionaryInterfaceType,
						  out this.collectionAddMethod,
						  out this.collectionCountMethod
						  ))
				{
					Debug.Assert(this.collectionInterfaceType != null);

					Type itf = this.dictionaryInterfaceType ?? this.collectionInterfaceType;
					Type[] genArgs = itf.GetGenericArguments();

					if (this.dictionaryInterfaceType != null)
					{
						this.serializationType = PropertySerializationType.Dictionary;
						this.elementType = typeof(KeyValuePair<,>).MakeGenericType(genArgs);
						this.dictionaryKeyType = genArgs[0];
						this.dictionaryValueType = genArgs[1];
					}
					else
					{
						this.serializationType = PropertySerializationType.List;
						this.elementType = genArgs[0];
					}
				}
				else  // if (not a collection)
				{
					//  Check for Nullable<>
					for (; t != null; t = t.BaseType)
					{
						if (t.IsGenericType)
						{
							Type genType = t.GetGenericTypeDefinition();

							if (genType == typeof(Nullable<>))
							{
								this.serializationType = PropertySerializationType.NullableValue;
								break;
							}
						}
					}

					if ((t == null) && (IsDynamic == false))
					{
						if (this.attribute != null
							&& String.IsNullOrEmpty(this.attribute.ReadMethod) == false
							&& String.IsNullOrEmpty(this.attribute.WriteMethod) == false)
						{
							//it's ok, custom serialization
						}
						else
						{
							throw new InvalidOperationException(string.Format("The type {0} cannot be serialized", this.Type.Name));
						}
					}
				}
			}

			if (
				 IsDynamic && !(
					  ((this.elementType == null) || (this.elementType.IsValueType == false))
					  && ((this.dictionaryKeyType == null) || (this.dictionaryKeyType.IsValueType == false))
					  && ((this.dictionaryValueType == null) || (this.dictionaryValueType.IsValueType == false))
					  )
				 )
			{
				throw new InvalidOperationException(string.Format(
								"The dynamic property {0} does not specify any non-value types to serialize",
								this.Name
								));
			}
		}
		void DeterminePropertyType(bool indexer)
		{
			Type t = this.Type;
			bool serializable = Serializer.IsSerializable(t);
			this.elementType = t;

			if (
				 (indexer == false)
				 && (
					  t.IsValueType
					  || (t == typeof(string))
					  || serializable
					  )
				 )
			{
				//  Not a collection or array
			}
			else if (t.IsArray)
			{
				this.elementType = t.GetElementType();
				this.serializationType |= PropertySerializationType.Array;
			}
			else // check for ICollection<> or IDictionary<> or Nullable<>
			{
				if (FindCollectionInterface(
						  t,
						  out this.collectionInterfaceType,
						  out this.dictionaryInterfaceType,
						  out this.collectionAddMethod,
						  out this.collectionCountMethod
						  ))
				{
					Debug.Assert(this.collectionInterfaceType != null);

					Type itf = this.dictionaryInterfaceType ?? this.collectionInterfaceType;
					Type[] genArgs = itf.GetGenericArguments();

					if (this.dictionaryInterfaceType != null)
					{
						this.serializationType = PropertySerializationType.Dictionary;
						this.elementType = typeof(KeyValuePair<,>).MakeGenericType(genArgs);
						this.dictionaryKeyType = genArgs[0];
						this.dictionaryValueType = genArgs[1];
					}
					else
					{
						this.serializationType = PropertySerializationType.List;
						this.elementType = genArgs[0];
					}
				}
				else  // if (not a collection)
				{
					//  Check for Nullable<>
					for (; t != null; t = t.BaseType)
					{
						if (t.IsGenericType)
						{
							Type genType = t.GetGenericTypeDefinition();

							if (genType == typeof(Nullable<>))
							{
								this.serializationType = PropertySerializationType.NullableValue;
								break;
							}
						}
					}

					if ((t == null) && (IsDynamic == false))
					{
						if (this.attribute != null
							&& String.IsNullOrEmpty(this.attribute.ReadMethod) == false
							&& String.IsNullOrEmpty(this.attribute.WriteMethod) == false)
						{
							//it's ok, custom serialization
						}
						else
						{
							throw new InvalidOperationException(string.Format("The type {0} cannot be serialized", this.Type.Name));
						}
					}
				}
			}

			if (
				 IsDynamic && !(
					  ((this.elementType == null) || (this.elementType.IsValueType == false))
					  && ((this.dictionaryKeyType == null) || (this.dictionaryKeyType.IsValueType == false))
					  && ((this.dictionaryValueType == null) || (this.dictionaryValueType.IsValueType == false))
					  )
				 )
			{
				throw new InvalidOperationException(string.Format(
								"The dynamic property {0} does not specify any non-value types to serialize",
								this.Name
								));
			}
		}