/// <summary>
 /// Tests if <c>propertyValue</c> of property named <c>propertyName</c>
 /// meets the requirements. Requirements are given by
 /// <see cref="T:Ferda.Modules.Serializer.BoxSerializer.Restriction">restrictions</see>.
 /// Iff <c>propertyValue</c> doesn`t meet the requirements than 
 /// <see cref="T:Ferda.Modules.BadValueError"/> is thrown.
 /// </summary>
 /// <param name="boxInfo">The box info</param>
 /// <param name="propertyName">Name of property.</param>
 /// <param name="propertyValue">A <see cref="T:Ferda.Modules.TimeT"/> value of property.</param>
 /// <exception cref="T:Ferda.Modules.BadValueError">
 /// This execption is thrown iff <c>propertyValue</c> doesn`t satisfy restrictions.
 /// </exception>
 public static void TryIsTimePropertyCorrect(IBoxInfo boxInfo, string propertyName, TimeT propertyValue)
 {
     //TODO BODY (BoxInfo.TryIsTimePropertyCorrect())
 }
Esempio n. 2
0
        public static DataType CreateDataTypeBasedOnId(string id, XElement element)
        {
            switch (id)
            {
            case "BooleanT":
            {
                var dataType = new BooleanT();
                dataType.Deserialize(element);

                return(dataType);
            }

            case "Float32T":
            {
                var dataType = new Float32T();
                dataType.Deserialize(element);

                return(dataType);
            }

            case "OctetStringT":
            {
                var dataType = new OctetStringT();
                dataType.Deserialize(element);

                return(dataType);
            }

            case "StringT":
            {
                var dataType = new StringT();
                dataType.Deserialize(element);

                return(dataType);
            }

            case "TimeSpanT":
            {
                var dataType = new TimeSpanT();
                dataType.Deserialize(element);

                return(dataType);
            }

            case "TimeT":
            {
                var dataType = new TimeT();
                dataType.Deserialize(element);

                return(dataType);
            }

            case "IntegerT":
            case "UIntegerT":
            {
                var dataType = new UIntegerT();
                dataType.Deserialize(element);

                return(dataType);
            }

            default:
            {
                var dataType = new DataType();
                dataType.Deserialize(element);

                return(dataType);
            }
            }
        }