private FieldConverterAttribute(ConverterKind converter, params string[] args)
		{
            Kind = converter;
            
			Type convType;

			switch (converter)
			{
				case ConverterKind.Date:
					convType = typeof (ConvertHelpers.DateTimeConverter);
					break;

				case ConverterKind.Byte:
					convType = typeof (ConvertHelpers.ByteConverter);
					break;

                case ConverterKind.SByte:
                    convType = typeof(ConvertHelpers.SByteConverter);
                    break;

				case ConverterKind.Int16:
					convType = typeof (ConvertHelpers.Int16Converter);
					break;
				case ConverterKind.Int32:
					convType = typeof (ConvertHelpers.Int32Converter);
					break;
				case ConverterKind.Int64:
					convType = typeof (ConvertHelpers.Int64Converter);
					break;

                case ConverterKind.UInt16:
                    convType = typeof(ConvertHelpers.UInt16Converter);
                    break;
                case ConverterKind.UInt32:
                    convType = typeof(ConvertHelpers.UInt32Converter);
                    break;
                case ConverterKind.UInt64:
                    convType = typeof(ConvertHelpers.UInt64Converter);
                    break;

                case ConverterKind.Decimal:
					convType = typeof (ConvertHelpers.DecimalConverter);
					break;
				case ConverterKind.Double:
					convType = typeof (ConvertHelpers.DoubleConverter);
					break;
				case ConverterKind.Single:
					convType = typeof (ConvertHelpers.SingleConverter);
					break;
				case ConverterKind.Boolean:
					convType = typeof (ConvertHelpers.BooleanConverter);
					break;
				default:
					throw new BadUsageException("Converter '" + converter.ToString() + "' not found, you must specify a valid converter.");

			}
			//mType = type;

			CreateConverter(convType, args);
		}
示例#2
0
        private FieldConverterAttribute(ConverterKind converter, params string[] args)
        {
            Type convType;

            switch (converter)
            {
            case ConverterKind.Date:
                convType = typeof(ConvertHelpers.DateTimeConverter);
                break;

            case ConverterKind.Byte:
                convType = typeof(ConvertHelpers.SByteConverter);
                break;

            case ConverterKind.Int16:
                convType = typeof(ConvertHelpers.Int16Converter);
                break;

            case ConverterKind.Int32:
                convType = typeof(ConvertHelpers.Int32Converter);
                break;

            case ConverterKind.Int64:
                convType = typeof(ConvertHelpers.Int64Converter);
                break;

            case ConverterKind.Decimal:
                convType = typeof(ConvertHelpers.DecimalConverter);
                break;

            case ConverterKind.Double:
                convType = typeof(ConvertHelpers.DoubleConverter);
                break;

            case ConverterKind.Single:
                convType = typeof(ConvertHelpers.SingleConverter);
                break;

            case ConverterKind.Boolean:
                convType = typeof(ConvertHelpers.BooleanConverter);
                break;

            default:
                throw new BadUsageException("Converter '" + converter.ToString() + "' not found, you must specify a valid converter.");
            }
            //mType = type;

            CreateConverter(convType, args);
        }
 /// <summary>Indicates the <see cref="ConverterKind"/> used for read/write operations. </summary>
 /// <param name="converter">The <see cref="ConverterKind"/> used for the transformations.</param>
 /// <param name="arg1">The first param passed directly to the Converter Constructor.</param>
 public FieldConverterAttribute(ConverterKind converter, string arg1)
     : this(converter, new string[] {arg1})
 {
 }
 /// <summary>Indicates the <see cref="ConverterKind"/> used for read/write operations. </summary>
 /// <param name="converter">The <see cref="ConverterKind"/> used for the transformations.</param>
 public FieldConverterAttribute(ConverterKind converter)
     : this(converter, new string[] {})
 {
 }
        /// <summary>
        /// Indicates the <see cref="ConverterKind"/> used for read/write operations.
        /// </summary>
        /// <param name="converter">The <see cref="ConverterKind"/> used for the transformations.</param>
        /// <param name="args">An array of parameters passed directly to the Converter</param>
        private FieldConverterAttribute(ConverterKind converter, params string[] args)
        {
            Kind = converter;

            Type convType;

            switch (converter)
            {
            case ConverterKind.Date:
                convType = typeof(ConvertHelpers.DateTimeConverter);
                break;

            case ConverterKind.DateMultiFormat:
                convType = typeof(ConvertHelpers.DateTimeMultiFormatConverter);
                break;

            case ConverterKind.Byte:
                convType = typeof(ConvertHelpers.ByteConverter);
                break;

            case ConverterKind.SByte:
                convType = typeof(ConvertHelpers.SByteConverter);
                break;

            case ConverterKind.Int16:
                convType = typeof(ConvertHelpers.Int16Converter);
                break;

            case ConverterKind.Int32:
                convType = typeof(ConvertHelpers.Int32Converter);
                break;

            case ConverterKind.Int64:
                convType = typeof(ConvertHelpers.Int64Converter);
                break;

            case ConverterKind.UInt16:
                convType = typeof(ConvertHelpers.UInt16Converter);
                break;

            case ConverterKind.UInt32:
                convType = typeof(ConvertHelpers.UInt32Converter);
                break;

            case ConverterKind.UInt64:
                convType = typeof(ConvertHelpers.UInt64Converter);
                break;

            case ConverterKind.Decimal:
                convType = typeof(ConvertHelpers.DecimalConverter);
                break;

            case ConverterKind.Double:
                convType = typeof(ConvertHelpers.DoubleConverter);
                break;

            // Added by Shreyas Narasimhan 17 March 2010
            case ConverterKind.PercentDouble:
                convType = typeof(ConvertHelpers.PercentDoubleConverter);
                break;

            case ConverterKind.Single:
                convType = typeof(ConvertHelpers.SingleConverter);
                break;

            case ConverterKind.Boolean:
                convType = typeof(ConvertHelpers.BooleanConverter);
                break;

            // Added by Alexander Obolonkov 2007.11.08
            case ConverterKind.Char:
                convType = typeof(ConvertHelpers.CharConverter);
                break;

            // Added by Alexander Obolonkov 2007.11.08
            case ConverterKind.Guid:
                convType = typeof(ConvertHelpers.GuidConverter);
                break;

            default:
                throw new BadUsageException("Converter '" + converter.ToString() +
                                            "' not found, you must specify a valid converter.");
            }
            //mType = type;

            CreateConverter(convType, args);
        }
 /// <summary>Indicates the <see cref="ConverterKind"/> used for read/write operations. </summary>
 /// <param name="converter">The <see cref="ConverterKind"/> used for the transformations.</param>
 /// <param name="arg1">The first param passed directly to the Converter Constructor.</param>
 /// <param name="arg2">The second param passed directly to the Converter Constructor.</param>
 /// <param name="arg3">The third param passed directly to the Converter Constructor.</param>
 public FieldConverterAttribute(ConverterKind converter, string arg1, string arg2, string arg3)
     : this(converter, new string[] { arg1, arg2, arg3 })
 {
 }
 /// <summary>Indicates the <see cref="ConverterKind"/> used for read/write operations. </summary>
 /// <param name="converter">The <see cref="ConverterKind"/> used for the transformations.</param>
 /// <param name="arg1">The first param passed directly to the Converter Constructor.</param>
 public FieldConverterAttribute(ConverterKind converter, string arg1)
     : this(converter, new string[] { arg1 })
 {
 }
 /// <summary>Indicates the <see cref="ConverterKind"/> used for read/write operations. </summary>
 /// <param name="converter">The <see cref="ConverterKind"/> used for the transformations.</param>
 public FieldConverterAttribute(ConverterKind converter)
     : this(converter, new string[] {})
 {
 }
 public string GetName(NameMangler nameMangler)
 {
     return(ConverterKind.ToString() + Signature.GetMangledName(nameMangler));
 }
示例#10
0
 /// <summary>
 /// The converter's constructor
 /// </summary>
 /// <param name="kind">The kind of conversion to apply</param>
 /// <param name="recursive">A value indicating whether this instance will deserialize entities like `TypeUnion{A,TypeUnion{B, C}}` with the same Kind property</param>
 internal OoakNewtonsoftJsonConverter(ConverterKind kind, bool recursive = false)
 {
     this.Kind      = kind;
     this.Recursive = recursive;
 }
示例#11
0
        /// <summary>
        /// Indicates the <see cref="ConverterKind"/> used for read/write operations.
        /// </summary>
        /// <param name="converter">The <see cref="ConverterKind"/> used for the transformations.</param>
        /// <param name="args">An array of parameters passed directly to the Converter</param>
        private FieldConverterAttribute(ConverterKind converter, params object[] args)
        {
            Kind = converter;

            Type convType;

            switch (converter)
            {
            case ConverterKind.Date:
                convType = typeof(DateTimeConverter);
                break;

            case ConverterKind.DateMultiFormat:
                convType = typeof(DateTimeMultiFormatConverter);
                break;

            case ConverterKind.Byte:
                convType = typeof(ByteConverter);
                break;

            case ConverterKind.SByte:
                convType = typeof(SByteConverter);
                break;

            case ConverterKind.Int16:
                convType = typeof(Int16Converter);
                break;

            case ConverterKind.Int32:
                convType = typeof(Int32Converter);
                break;

            case ConverterKind.Int64:
                convType = typeof(Int64Converter);
                break;

            case ConverterKind.UInt16:
                convType = typeof(UInt16Converter);
                break;

            case ConverterKind.UInt32:
                convType = typeof(UInt32Converter);
                break;

            case ConverterKind.UInt64:
                convType = typeof(UInt64Converter);
                break;

            case ConverterKind.Decimal:
                convType = typeof(DecimalConverter);
                break;

            case ConverterKind.Double:
                convType = typeof(DoubleConverter);
                break;

            case ConverterKind.PercentDouble:
                convType = typeof(PercentDoubleConverter);
                break;

            case ConverterKind.Single:
                convType = typeof(SingleConverter);
                break;

            case ConverterKind.Boolean:
                convType = typeof(BooleanConverter);
                break;

            // Added by Alexander Obolonkov 2007.11.08
            case ConverterKind.Char:
                convType = typeof(CharConverter);
                break;

            // Added by Alexander Obolonkov 2007.11.08
            case ConverterKind.Guid:
                convType = typeof(GuidConverter);
                break;

            default:
                throw new BadUsageException($"Converter '{ converter}' not found, you must specify a valid converter.");
            }

            CreateConverter(convType, args);
        }
示例#12
0
 /// <summary>Indicates the <see cref="ConverterKind"/> used for read/write operations. </summary>
 /// <param name="converter">The <see cref="ConverterKind"/> used for the transformations.</param>
 /// <param name="arg1">The first param passed directly to the Converter Constructor.</param>
 /// <param name="arg2">The second param passed directly to the Converter Constructor.</param>
 public FieldConverterAttribute(ConverterKind converter, string arg1, string arg2)
     : this(converter, new object[] { arg1, arg2 })
 {
 }
示例#13
0
 /// <summary>Indicates the <see cref="ConverterKind"/> used for read/write operations. </summary>
 /// <param name="converter">The <see cref="ConverterKind"/> used for the transformations.</param>
 public FieldConverterAttribute(ConverterKind converter)
     : this(converter, new object[] {})
 {
 }
 /// <summary>
 ///     Indicates the <see cref="ConverterKind" /> used for read/write ops.
 /// </summary>
 /// <param name="converter">
 ///     The <see cref="ConverterKind" /> used for the transformations.
 /// </param>
 /// <param name="arg1">The first param pased directly to the Converter Constructor.</param>
 /// <param name="arg2">The second param pased directly to the Converter Constructor.</param>
 public FieldConverterAttribute(ConverterKind converter, string arg1, string arg2)
     : this(converter, new[] {arg1, arg2})
 {
 }
 /// <summary>Indicates the <see cref="ConverterKind"/> used for read/write operations. </summary>
 /// <param name="converter">The <see cref="ConverterKind"/> used for the transformations.</param>
 /// <param name="arg1">The first param passed directly to the Converter Constructor.</param>
 /// <param name="arg2">The second param passed directly to the Converter Constructor.</param>
 /// <param name="arg3">The third param passed directly to the Converter Constructor.</param>
 public FieldConverterAttribute(ConverterKind converter, string arg1, string arg2, string arg3)
     : this(converter, new string[] {arg1, arg2, arg3})
 {
 }
示例#16
0
 public string GetName()
 {
     return(ConverterKind.ToString() + Signature.GetName());
 }
        /// <summary>
        /// Indicates the <see cref="ConverterKind"/> used for read/write operations. 
        /// </summary>
        /// <param name="converter">The <see cref="ConverterKind"/> used for the transformations.</param>
        /// <param name="args">An array of parameters passed directly to the Converter</param>
        private FieldConverterAttribute(ConverterKind converter, params string[] args)
        {
            Kind = converter;

            Type convType;

            switch (converter) {
                case ConverterKind.Date:
                    convType = typeof (ConvertHelpers.DateTimeConverter);
                    break;

                case ConverterKind.DateMultiFormat:
                    convType = typeof (ConvertHelpers.DateTimeMultiFormatConverter);
                    break;

                case ConverterKind.Byte:
                    convType = typeof (ConvertHelpers.ByteConverter);
                    break;

                case ConverterKind.SByte:
                    convType = typeof (ConvertHelpers.SByteConverter);
                    break;

                case ConverterKind.Int16:
                    convType = typeof (ConvertHelpers.Int16Converter);
                    break;
                case ConverterKind.Int32:
                    convType = typeof (ConvertHelpers.Int32Converter);
                    break;
                case ConverterKind.Int64:
                    convType = typeof (ConvertHelpers.Int64Converter);
                    break;

                case ConverterKind.UInt16:
                    convType = typeof (ConvertHelpers.UInt16Converter);
                    break;
                case ConverterKind.UInt32:
                    convType = typeof (ConvertHelpers.UInt32Converter);
                    break;
                case ConverterKind.UInt64:
                    convType = typeof (ConvertHelpers.UInt64Converter);
                    break;

                case ConverterKind.Decimal:
                    convType = typeof (ConvertHelpers.DecimalConverter);
                    break;
                case ConverterKind.Double:
                    convType = typeof (ConvertHelpers.DoubleConverter);
                    break;
                    // Added by Shreyas Narasimhan 17 March 2010
                case ConverterKind.PercentDouble:
                    convType = typeof (ConvertHelpers.PercentDoubleConverter);
                    break;
                case ConverterKind.Single:
                    convType = typeof (ConvertHelpers.SingleConverter);
                    break;
                case ConverterKind.Boolean:
                    convType = typeof (ConvertHelpers.BooleanConverter);
                    break;
                    // Added by Alexander Obolonkov 2007.11.08
                case ConverterKind.Char:
                    convType = typeof (ConvertHelpers.CharConverter);
                    break;
                    // Added by Alexander Obolonkov 2007.11.08
                case ConverterKind.Guid:
                    convType = typeof (ConvertHelpers.GuidConverter);
                    break;
                default:
                    throw new BadUsageException("Converter '" + converter.ToString() +
                                                "' not found, you must specify a valid converter.");
            }
            //mType = type;

            CreateConverter(convType, args);
        }
 /// <summary>
 /// The converter's constructor
 /// </summary>
 /// <param name="kind">The kind of conversion to apply</param>
 /// <param name="recursive">A value indicating whether this instance will deserialize entities like `TypeUnion{A,TypeUnion{B, C}}` with the same Kind property</param>
 internal OoakSystemTextJsonConverter(ConverterKind kind, bool recursive = false)
 {
     this.Kind      = kind;
     this.Recursive = recursive;
 }