Exemple #1
0
        internal static FormControlInfo ReadWithoutDataType(BinaryReader reader, int length)
        {
            var startPosition = reader.BaseStream.Position;
            var elem          = new FormControlInfo()
            {
            };

            elem.UnknownBeforeName = reader.ReadBytes(20);
            elem.Name              = reader.ReadCStyleString();
            elem.Comment           = reader.ReadCStyleString();
            elem.UnknownBeforeLeft = reader.ReadInt32();
            elem.Left              = reader.ReadInt32();
            elem.Top    = reader.ReadInt32();
            elem.Width  = reader.ReadInt32();
            elem.Height = reader.ReadInt32();
            elem.UnknownBeforeParent = reader.ReadInt32();
            elem.Parent               = reader.ReadInt32();
            elem.Children             = reader.ReadInt32sWithLengthPrefix();
            elem.Cursor               = reader.ReadBytesWithLengthPrefix();
            elem.Tag                  = reader.ReadCStyleString();
            elem.UnknownBeforeVisible = reader.ReadInt32();
            {
                int showStatus = reader.ReadInt32();
                elem.Visible = (showStatus & 0x1) != 0;
                elem.Disable = (showStatus & 0x2) != 0;
            }
            elem.UnknownBeforeEvents = reader.ReadInt32();
            elem.Events = new object[reader.ReadInt32()].Select(x => new KeyValuePair <int, int>(reader.ReadInt32(), reader.ReadInt32())).ToArray();
            elem.UnknownBeforeExtensionData = reader.ReadBytes(20);
            elem.ExtensionData = reader.ReadBytes(length - (int)(reader.BaseStream.Position - startPosition));
            return(elem);
        }
Exemple #2
0
        internal static FormControlInfo ReadWithoutDataType(BinaryReader reader, int length)
        {
            long            position        = reader.BaseStream.Position;
            FormControlInfo formControlInfo = new FormControlInfo();

            formControlInfo.UnknownBeforeName = reader.ReadBytes(20);
            formControlInfo.Name              = reader.ReadCStyleString();
            formControlInfo.Comment           = reader.ReadCStyleString();
            formControlInfo.UnknownBeforeLeft = reader.ReadInt32();
            formControlInfo.Left              = reader.ReadInt32();
            formControlInfo.Top    = reader.ReadInt32();
            formControlInfo.Width  = reader.ReadInt32();
            formControlInfo.Height = reader.ReadInt32();
            formControlInfo.UnknownBeforeParent = reader.ReadInt32();
            formControlInfo.Parent               = reader.ReadInt32();
            formControlInfo.Children             = reader.ReadInt32sWithLengthPrefix();
            formControlInfo.Cursor               = reader.ReadBytesWithLengthPrefix();
            formControlInfo.Tag                  = reader.ReadCStyleString();
            formControlInfo.UnknownBeforeVisible = reader.ReadInt32();
            int num = reader.ReadInt32();

            formControlInfo.Visible             = ((num & 1) != 0);
            formControlInfo.Disable             = ((num & 2) != 0);
            formControlInfo.UnknownBeforeEvents = reader.ReadInt32();
            formControlInfo.Events = (from x in new object[reader.ReadInt32()]
                                      select new KeyValuePair <int, int>(reader.ReadInt32(), reader.ReadInt32())).ToArray();
            formControlInfo.UnknownBeforeExtensionData = reader.ReadBytes(20);
            formControlInfo.ExtensionData = reader.ReadBytes(length - (int)(reader.BaseStream.Position - position));
            return(formControlInfo);
        }
Exemple #3
0
 public static FormElementInfo[] ReadFormElements(BinaryReader r)
 {
     return(r.ReadBlocksWithIdAndOffest(delegate(BinaryReader reader, int id, int length)
     {
         int num = reader.ReadInt32();
         FormElementInfo formElementInfo = (num != 65539) ?
                                           ((FormElementInfo)FormControlInfo.ReadWithoutDataType(r, length - 4))
         : ((FormElementInfo)FormMenuInfo.ReadWithoutDataType(r, length - 4));
         formElementInfo.id = id;
         formElementInfo.DataType = num;
         return formElementInfo;
     }));
 }
Exemple #4
0
 public static FormElementInfo[] ReadFormElements(BinaryReader r)
 {
     return(r.ReadBlocksWithIdAndOffest((reader, id, length) =>
     {
         var dataType = reader.ReadInt32();
         FormElementInfo elem;
         if (dataType == 65539)
         {
             elem = FormMenuInfo.ReadWithoutDataType(r, length - 4);
         }
         else
         {
             elem = FormControlInfo.ReadWithoutDataType(r, length - 4);
         }
         elem.id = id;
         elem.DataType = dataType;
         return elem;
     }));
 }