Пример #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     OD.ShowDialog();
     System.IO.FileStream fs = new System.IO.FileStream(OD.FileName, System.IO.FileMode.Open);
     System.Runtime.Serialization.Formatters.Binary.BinaryFormatter BF = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
     PacketProxy.PacketContainer pc = new PacketProxy.PacketContainer();
     PacketProxy.PacketContainer.Instance = (PacketProxy.PacketContainer)BF.Deserialize(fs);
     fs.Close();
     if (radioButton1.Checked)
     {
         currentList = PacketProxy.PacketContainer.Instance.packets;
     }
     else
     {
         currentList = PacketProxy.PacketContainer.Instance.packets2;
     }
     currentIndex = 0;
     showPacket();
     list.Items.Clear();
     foreach (SagaLib.Packet i in currentList)
     {
         string tmp = string.Format("0x{0:X4}", i.ID);
         if (list.Items.Contains(tmp))
         {
             continue;
         }
         list.Items.Add(tmp, CheckState.Checked);
     }
 }
Пример #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     OD.ShowDialog();
     System.IO.FileStream fs = new System.IO.FileStream(OD.FileName, System.IO.FileMode.Open);
     System.Runtime.Serialization.Formatters.Binary.BinaryFormatter BF = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
     PacketProxy.PacketContainer pc = new PacketProxy.PacketContainer();
     PacketProxy.PacketContainer.Instance = (PacketProxy.PacketContainer)BF.Deserialize(fs);
     fs.Close();
     if (radioButton1.Checked)
         currentList = PacketProxy.PacketContainer.Instance.packets;
     else
         currentList = PacketProxy.PacketContainer.Instance.packets2;
     currentIndex = 0;
     showPacket();
     list.Items.Clear();
     foreach (SagaLib.Packet i in currentList)
     {
         string tmp = string.Format("0x{0:X4}", i.ID);
         if (list.Items.Contains(tmp))
             continue;
         list.Items.Add(tmp, CheckState.Checked);
     }
 }