public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            PropertyDescriptorCollection collection = new PropertyDescriptorCollection((PropertyDescriptor[])null);

            foreach (FIXField field in ((FIXGroup)this.definition).Fields)
            {
                switch ((int)field.Tag)
                {
                case 454:
                case 555:
                case 711:
                case 320:
                case 322:
                case 323:
                case 393:
                    goto case 454;

                default:
                    if (field.GetValue() != null)
                    {
                        collection.Add((PropertyDescriptor) new FIXFieldPropertyDescriptor(field, "_"));
                        goto case 454;
                    }
                    else
                    {
                        goto case 454;
                    }
                }
            }
            FIXGroup[] groups1 = new FIXGroup[this.definition.NoUnderlyings];
            for (int index = 0; index < groups1.Length; ++index)
            {
                groups1[index] = (FIXGroup)this.definition.GetUnderlyingsGroup(index);
            }
            this.AddGroups(collection, groups1, "Underlying");
            FIXGroup[] groups2 = new FIXGroup[this.definition.NoLegs];
            for (int index = 0; index < groups2.Length; ++index)
            {
                groups2[index] = (FIXGroup)this.definition.GetLegsGroup(index);
            }
            this.AddGroups(collection, groups2, "Leg");
            FIXGroup[] groups3 = new FIXGroup[this.definition.NoSecurityAltID];
            for (int index = 0; index < groups3.Length; ++index)
            {
                groups3[index] = (FIXGroup)this.definition.GetSecurityAltIDGroup(index);
            }
            this.AddGroups(collection, groups3, "SecurityAltID");
            return(collection);
        }
Exemplo n.º 2
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());
                }
            }
        }
Exemplo n.º 3
0
        public static void WriteTo(BinaryWriter writer, FIXGroup group)
        {
            writer.Write(group.Fields.Length);
            foreach (FIXField fixField in group.Fields)
            {
                writer.Write(fixField.Tag);
                switch (fixField.FIXType)
                {
                case FIXType.Bool:
                    writer.Write(((FIXBoolField)fixField).Value);
                    break;

                case FIXType.Int:
                    writer.Write(((FIXIntField)fixField).Value);
                    break;

                case FIXType.Double:
                    writer.Write(((FIXDoubleField)fixField).Value);
                    break;

                case FIXType.Char:
                    writer.Write(((FIXCharField)fixField).Value);
                    break;

                case FIXType.String:
                    writer.Write(((FIXStringField)fixField).Value);
                    break;

                case FIXType.DateTime:
                    writer.Write(((FIXDateTimeField)fixField).Value.Ticks);
                    break;

                default:
                    throw new ArgumentException("" + ((object)fixField.FIXType).ToString());
                }
            }
        }