Exemple #1
0
 void _gameSlave_ValidateCodeNeeded(byte[] image, string taskid, string taskname)
 {
     try
     {
         if (this.InvokeRequired)
         {
             this.Invoke(new KaixinBase.ValidateCodeNeededEventHandler(_gameSlave_ValidateCodeNeeded), new object[] { image, taskid, taskname });
         }
         else
         {
             DlgPicCode picCode = new DlgPicCode();
             picCode.ValidationImage = image;
             picCode.WindowsCaption  = base.VALIDATION_CAPTION;
             if (picCode.ShowDialog() == DialogResult.OK)
             {
                 _gameSlave.ValidationCode = picCode.ValidationCode;
             }
             else
             {
                 _gameSlave.ValidationCode = null;
             }
         }
     }
     catch (Exception ex)
     {
         Program.ShowMessageBox("DlgSlaveSelection._gameSlave_ValidateCodeNeeded", ex);
     }
 }
Exemple #2
0
 void _toolbuycards_ValidateCodeNeeded(byte[] image, string taskid, string taskname)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new KaixinBase.ValidateCodeNeededEventHandler(_toolbuycards_ValidateCodeNeeded), new object[] { image, taskid, taskname });
     }
     else
     {
         DlgPicCode picCode = new DlgPicCode();
         picCode.ValidationImage = image;
         picCode.WindowsCaption = "购买道具";
         if (picCode.ShowDialog() == DialogResult.OK)
             _toolbuycards.ValidationCode = picCode.ValidationCode;
         else
             _toolbuycards.ValidationCode = null;
     }
 }
Exemple #3
0
 void _toolupdatedata_ValidateCodeNeeded(byte[] image, string taskid, string taskname)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new KaixinBase.ValidateCodeNeededEventHandler(_toolupdatedata_ValidateCodeNeeded), new object[] { image, taskid, taskname });
     }
     else
     {
         DlgPicCode picCode = new DlgPicCode();
         picCode.ValidationImage = image;
         picCode.WindowsCaption = "更新数据";
         if (picCode.ShowDialog() == DialogResult.OK)
             //_toolupdatedata.ValidationCode = picCode.ValidationCode;
             _toolupdatedata.UpdateValidationCode(picCode.ValidationCode);
         else
             //_toolupdatedata.RetryLogin = false;
             //_toolupdatedata.UpdateRetryLogin(false);
             _toolupdatedata.UpdateValidationCode(null);
     }
 }
Exemple #4
0
 void _tooladdfriends_ValidateCodeNeeded(byte[] image, string taskid, string taskname)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new KaixinBase.ValidateCodeNeededEventHandler(_tooladdfriends_ValidateCodeNeeded), new object[] { image, taskid, taskname });
     }
     else
     {
         DlgPicCode picCode = new DlgPicCode();
         picCode.ValidationImage = image;
         picCode.WindowsCaption  = "互加好友";
         if (picCode.ShowDialog() == DialogResult.OK)
         {
             _tooladdfriends.ValidationCode = picCode.ValidationCode;
         }
         else
         {
             _tooladdfriends.ValidationCode = null;
         }
     }
 }
 void _gameFish_ValidateCodeNeeded(byte[] image, string taskid, string taskname)
 {
     try
     {
         if (this.InvokeRequired)
         {
             this.Invoke(new KaixinBase.ValidateCodeNeededEventHandler(_gameFish_ValidateCodeNeeded), new object[] { image, taskid, taskname });
         }
         else
         {
             DlgPicCode picCode = new DlgPicCode();
             picCode.ValidationImage = image;
             picCode.WindowsCaption = base.VALIDATION_CAPTION;
             if (picCode.ShowDialog() == DialogResult.OK)
                 _gameFish.ValidationCode = picCode.ValidationCode;
             else
                 _gameFish.ValidationCode = null;
         }
     }
     catch (Exception ex)
     {
         Program.ShowMessageBox("DlgFishSelection._gameRanch_ValidateCodeNeeded", ex);
     }
 }
Exemple #6
0
 void _toolupdatedata_ValidateCodeNeeded(byte[] image, string taskid, string taskname)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new KaixinBase.ValidateCodeNeededEventHandler(_toolupdatedata_ValidateCodeNeeded), new object[] { image, taskid, taskname });
     }
     else
     {
         DlgPicCode picCode = new DlgPicCode();
         picCode.ValidationImage = image;
         picCode.WindowsCaption  = "更新数据";
         if (picCode.ShowDialog() == DialogResult.OK)
         {
             //_toolupdatedata.ValidationCode = picCode.ValidationCode;
             _toolupdatedata.UpdateValidationCode(picCode.ValidationCode);
         }
         else
         {
             //_toolupdatedata.RetryLogin = false;
             //_toolupdatedata.UpdateRetryLogin(false);
             _toolupdatedata.UpdateValidationCode(null);
         }
     }
 }
Exemple #7
0
        void task_ValidateCodeNeeded(byte[] image, string taskid, string taskname)
        {
            try
            {
                if (this.InvokeRequired)
                {
                    this.Invoke(new KaixinBase.ValidateCodeNeededEventHandler(task_ValidateCodeNeeded), new object[] { image, taskid, taskname });
                }
                else
                {
                    DlgPicCode picCode = new DlgPicCode();
                    picCode.ValidationImage = image;
                    picCode.WindowsCaption = "任务:" + taskname;
                    if (picCode.ShowDialog() == DialogResult.OK)
                    {
                        TaskManager currentTaskManager;
                        if (_taskManagerList.TryGetValue(taskid, out currentTaskManager))
                        {
                            currentTaskManager.ValidationCode = picCode.ValidationCode;
                        }
                    }
                    else
                    {
                        TaskManager currentTaskManager;
                        if (_taskManagerList.TryGetValue(taskid, out currentTaskManager))
                        {
                            currentTaskManager.ValidationCode = null;
//                            currentTaskManager.RetryLogin = false;
                        }
                    }
                }
            }
            catch (ObjectDisposedException)
            {
                //do nothing
            }
            catch (ThreadAbortException)
            {
                //do nothing
            }
            catch (ThreadInterruptedException)
            {
                //do nothing
            }
            catch (Exception ex)
            {
                Program.ShowMessageBox("MainForm", ex);
            }
        }