예제 #1
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;
     }));
 }
예제 #2
0
파일: FormInfo.cs 프로젝트: hfen-cn/econv
 public static void WriteForms(BinaryWriter writer, FormInfo[] forms)
 {
     writer.Write(forms.Length * 8);
     Array.ForEach(forms, x => writer.Write(x.Id));
     Array.ForEach(forms, x => writer.Write(x.UnknownAfterId));
     foreach (var form in forms)
     {
         writer.Write(form.UnknownBeforeClass);
         writer.Write(form.Class);
         writer.WriteStringWithLengthPrefix(form.Name);
         writer.WriteStringWithLengthPrefix(form.Comment);
         FormElementInfo.WriteFormElements(writer, form.Elements);
     }
 }
예제 #3
0
파일: FormInfo.cs 프로젝트: hfen-cn/econv
        public static FormInfo[] ReadForms(BinaryReader reader)
        {
            int num  = reader.ReadInt32();
            int num2 = num / 8;

            int[]      array  = reader.ReadInt32sWithFixedLength(num2);
            int[]      array2 = reader.ReadInt32sWithFixedLength(num2);
            FormInfo[] array3 = new FormInfo[num2];
            for (int i = 0; i < num2; i++)
            {
                FormInfo formInfo = array3[i] = new FormInfo
                {
                    Id                 = array[i],
                    UnknownAfterId     = array2[i],
                    UnknownBeforeClass = reader.ReadInt32(),
                    Class              = reader.ReadInt32(),
                    Name               = reader.ReadStringWithLengthPrefix(),
                    Comment            = reader.ReadStringWithLengthPrefix(),
                    Elements           = FormElementInfo.ReadFormElements(reader)
                };
            }
            return(array3);
        }
예제 #4
0
파일: FormInfo.cs 프로젝트: hfen-cn/econv
        public static FormInfo[] ReadForms(BinaryReader reader)
        {
            var headerSize       = reader.ReadInt32();
            int count            = headerSize / 8;
            var ids              = reader.ReadInt32sWithFixedLength(count);
            var unknownsAfterIds = reader.ReadInt32sWithFixedLength(count);
            var forms            = new FormInfo[count];

            for (int i = 0; i < count; i++)
            {
                var form = new FormInfo()
                {
                    Id                 = ids[i],
                    UnknownAfterId     = unknownsAfterIds[i],
                    UnknownBeforeClass = reader.ReadInt32(),
                    Class              = reader.ReadInt32(),
                    Name               = reader.ReadStringWithLengthPrefix(),
                    Comment            = reader.ReadStringWithLengthPrefix(),
                    Elements           = FormElementInfo.ReadFormElements(reader)
                };
                forms[i] = form;
            }
            return(forms);
        }