示例#1
0
        public static FIXField Field(FIXType type, int tag, string value, bool invariantCulture = false)
        {
            switch (type)
            {
            case FIXType.Bool:
                return(new FIXBoolField(tag, value, invariantCulture));

            case FIXType.Int:
                return(new FIXIntField(tag, value, invariantCulture));

            case FIXType.Double:
                return(new FIXDoubleField(tag, value, invariantCulture));

            case FIXType.Char:
                return(new FIXCharField(tag, value, invariantCulture));

            case FIXType.String:
                return(new FIXStringField(tag, value, invariantCulture));

            case FIXType.DateTime:
                return(new FIXDateTimeField(tag, value, invariantCulture));

            default:
                throw new ArgumentException("Error: Unknown FIXType " + type);
            }
        }
示例#2
0
        public static FIXField Field(FIXType type, int tag)
        {
            switch (type)
            {
            case FIXType.Bool:
                return(new FIXBoolField(tag));

            case FIXType.Int:
                return(new FIXIntField(tag));

            case FIXType.Double:
                return(new FIXDoubleField(tag));

            case FIXType.Char:
                return(new FIXCharField(tag));

            case FIXType.String:
                return(new FIXStringField(tag));

            case FIXType.DateTime:
                return(new FIXDateTimeField(tag));

            case FIXType.NumInGroup:
                return(new FIXNumInGroupField(tag));

            default:
                throw new ArgumentException("Error: Unknown FIXType " + type);
            }
        }
示例#3
0
文件: FIXField.cs 项目: heber/FreeOQ
		public static FIXField Field(FIXType type, int tag, string value, bool invariantCulture = false)
		{
			switch (type)
			{
				case FIXType.Bool:
					return new FIXBoolField(tag, value, invariantCulture);
				case FIXType.Int:
					return new FIXIntField(tag, value, invariantCulture);
				case FIXType.Double:
					return new FIXDoubleField(tag, value, invariantCulture);
				case FIXType.Char:
					return new FIXCharField(tag, value, invariantCulture);
				case FIXType.String:
					return new FIXStringField(tag, value, invariantCulture);
				case FIXType.DateTime:
					return new FIXDateTimeField(tag, value, invariantCulture);
				default:
					throw new ArgumentException("Error: Unknown FIXType " + type);
			}
		}
示例#4
0
        public static void ReadFrom(BinaryReader reader, FIXGroup group)
        {
            int num = reader.ReadInt32();

            for (int index = 0; index < num; ++index)
            {
                int     tag     = reader.ReadInt32();
                FIXType fixType = EFIXFieldTypes.GetFIXType(tag);
                switch (fixType)
                {
                case FIXType.Bool:
                    group.AddBoolField(tag, reader.ReadBoolean());
                    break;

                case FIXType.Int:
                    group.AddIntField(tag, reader.ReadInt32());
                    break;

                case FIXType.Double:
                    group.AddDoubleField(tag, reader.ReadDouble());
                    break;

                case FIXType.Char:
                    group.AddCharField(tag, reader.ReadChar());
                    break;

                case FIXType.String:
                    group.AddStringField(tag, reader.ReadString());
                    break;

                case FIXType.DateTime:
                    group.AddDateTimeField(tag, new DateTime(reader.ReadInt64()));
                    break;

                default:
                    throw new ArgumentException("" + fixType.ToString());
                }
            }
        }
示例#5
0
文件: FIXField.cs 项目: heber/FreeOQ
		public static FIXField Field(FIXType type, int tag)
		{
			switch (type)
			{
				case FIXType.Bool:
					return new FIXBoolField(tag);
				case FIXType.Int:
					return new FIXIntField(tag);
				case FIXType.Double:
					return new FIXDoubleField(tag);
				case FIXType.Char:
					return new FIXCharField(tag);
				case FIXType.String:
					return new FIXStringField(tag);
				case FIXType.DateTime:
					return new FIXDateTimeField(tag);
				case FIXType.NumInGroup:
					return new FIXNumInGroupField(tag);
				default:
					throw new ArgumentException("Error: Unknown FIXType " + type);
			}
		}