Beispiel #1
0
 private void ReadData()
 {
     CDB.Read(CDBfile, select_str);
     Count = CDB.ids.Count;
     SetNum();
     Add_cardslist();
 }
        public override void Read(Stream stream)
        {
            using (BinaryReader br = new BinaryReader(stream))
            {
                if (toningTableDataBlockLength != 0)
                {
                    byte[] ToningTableDataBlockBytes = br.ReadBytes(toningTableDataBlockLength);
                    TTDB = new ToningTableDataBlock();
                    TTDB.Read(new MemoryStream(ToningTableDataBlockBytes));
                }

                if (calibrationDataBlockLength != 0)
                {
                    byte[] CalibrationDataBlockBytes = br.ReadBytes(calibrationDataBlockLength);
                    CDB.Read(new MemoryStream(CalibrationDataBlockBytes));
                }

                if (locationDataBlockLength != 0)
                {
                    byte[] LocationDataBlockBytes = br.ReadBytes(locationDataBlockLength);
                    LDB = new LocationDataBlock();
                    LDB.Read(new MemoryStream(LocationDataBlockBytes));
                }
            }
        }
Beispiel #3
0
        private void ToolStrip_SearchJPG_Click(object sender, EventArgs e)
        {
            string path;

            if (CCFile.SelectFolder(out path, "请选择:\n需要读取的卡片的图片文件夹(jpg格式)", ""))
            {
                CDB.Read(CDBfile, CCFile.FindFiles(path, "jpg", false));
                Count = CDB.ids.Count;
                SetNum();
                Add_cardslist();
            }
        }
Beispiel #4
0
        private void ToolStrip_ReadYDK_Click(object sender, EventArgs e)
        {
            string file;

            if (CCFile.SelectOpenFile(out file, "请选择卡组文件(.ydk)", "ydk", SET.GamePath + "deck"))
            {
                CDB.Read(CDBfile, CCFile.ReadYDK(file));
                Count = CDB.ids.Count;
                SetNum();
                Add_cardslist();
            }
        }
Beispiel #5
0
    public void Read(TProtocol iprot)
    {
        TField field;

        iprot.ReadStructBegin();
        while (true)
        {
            field = iprot.ReadFieldBegin();
            if (field.Type == TType.Stop)
            {
                break;
            }
            switch (field.ID)
            {
            case 1:
                if (field.Type == TType.String)
                {
                    Name = iprot.ReadString();
                }
                else
                {
                    TProtocolUtil.Skip(iprot, field.Type);
                }
                break;

            case 2:
                if (field.Type == TType.String)
                {
                    CronTime = iprot.ReadString();
                }
                else
                {
                    TProtocolUtil.Skip(iprot, field.Type);
                }
                break;

            case 3:
                if (field.Type == TType.String)
                {
                    UserName = iprot.ReadString();
                }
                else
                {
                    TProtocolUtil.Skip(iprot, field.Type);
                }
                break;

            case 4:
                if (field.Type == TType.List)
                {
                    {
                        Dbs = new List <CDB>();
                        TList _list0 = iprot.ReadListBegin();
                        for (int _i1 = 0; _i1 < _list0.Count; ++_i1)
                        {
                            CDB _elem2 = new CDB();
                            _elem2 = new CDB();
                            _elem2.Read(iprot);
                            Dbs.Add(_elem2);
                        }
                        iprot.ReadListEnd();
                    }
                }
                else
                {
                    TProtocolUtil.Skip(iprot, field.Type);
                }
                break;

            case 5:
                if (field.Type == TType.I32)
                {
                    BatchSaveNum = iprot.ReadI32();
                }
                else
                {
                    TProtocolUtil.Skip(iprot, field.Type);
                }
                break;

            default:
                TProtocolUtil.Skip(iprot, field.Type);
                break;
            }
            iprot.ReadFieldEnd();
        }
        iprot.ReadStructEnd();
    }
Beispiel #6
0
 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.String) {
           Name = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.String) {
           CronTime = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         if (field.Type == TType.String) {
           UserName = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 4:
         if (field.Type == TType.List) {
           {
             Dbs = new List<CDB>();
             TList _list0 = iprot.ReadListBegin();
             for( int _i1 = 0; _i1 < _list0.Count; ++_i1)
             {
               CDB _elem2 = new CDB();
               _elem2 = new CDB();
               _elem2.Read(iprot);
               Dbs.Add(_elem2);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 5:
         if (field.Type == TType.I32) {
           BatchSaveNum = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }