Exemple #1
0
        public void ProcessPayload(Stream s)
        {
            typeEntryList = new List <TypeEntryStruct>();
            int guidcount = 0;

            for (int i = 0; i < Header.typeCount; i++)
            {
                for (int j = 0; j < typeList[i].repetitions; j++)
                {
                    while ((s.Position % typeDescriptors[typeList[i].typeDescriptorIndex].alignment) != 0)
                    {
                        s.Seek(1, SeekOrigin.Current);
                    }
                    TypeEntryStruct entry = new TypeEntryStruct();
                    entry.name = typeDescriptors[typeList[i].typeDescriptorIndex]._name;
                    if (guidcount < Header.numGUIDRepeater)
                    {
                        entry.GUID = new Guid(s);
                    }
                    else
                    {
                        MemoryStream m2 = new MemoryStream(new byte[16]);
                        entry.GUID = new Guid(m2);
                    }
                    entry.type = ReadType(s, typeList[i].typeDescriptorIndex);
                    typeEntryList.Add(entry);
                }
                guidcount++;
            }
        }
Exemple #2
0
        public string InstanceToXML(TypeEntryStruct ins)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(Helpers.MakeTabs(1) + "<" + ins.name + " Guid=\"");
            sb.Append(ins.GUID.ToString());
            sb.Append("\">\n");
            sb.Append(MakeComplexFieldXML(ins.type, 2));
            sb.Append(Helpers.MakeTabs(1) + "</" + ins.name + ">\n");
            return(sb.ToString());
        }
Exemple #3
0
 public void ProcessPayload(Stream s)
 {
     typeEntryList = new List<TypeEntryStruct>();
     int guidcount = 0;
     for (int i = 0; i < Header.typeCount; i++)
     {
         for (int j = 0; j < typeList[i].repetitions; j++)
         {
             while ((s.Position % typeDescriptors[typeList[i].typeDescriptorIndex].alignment) != 0)
                 s.Seek(1, SeekOrigin.Current);
             TypeEntryStruct entry = new TypeEntryStruct();
             entry.name = typeDescriptors[typeList[i].typeDescriptorIndex]._name;
             if (guidcount < Header.numGUIDRepeater)
                 entry.GUID = new Guid(s);
             else
             {
                 MemoryStream m2 = new MemoryStream(new byte[16]);
                 entry.GUID = new Guid(m2);
             }
             entry.type = ReadType(s, typeList[i].typeDescriptorIndex);
             typeEntryList.Add(entry);
         }
         guidcount++;
     }
 }
Exemple #4
0
 public string InstanceToXML(TypeEntryStruct ins)
 {
     StringBuilder sb = new StringBuilder();
     sb.Append(Helpers.MakeTabs(1) + "<" + ins.name + " Guid=\"");
     sb.Append(ins.GUID.ToString());
     sb.Append("\">\n");
     sb.Append(MakeComplexFieldXML(ins.type, 2));
     sb.Append(Helpers.MakeTabs(1) + "</" + ins.name + ">\n");
     return sb.ToString();
 }