Пример #1
0
 private void OptionsDialog_Load(object sender, EventArgs e)
 {
     DllInterface.GetTorrentClientOptions(ref mOptions);
     mOptionCheck_ForceEncryption.Checked          = (mOptions.mAllConnectionsMustBeEncrypted != 0);
     mOptionCheck_EnableDht.Checked                = (mOptions.mUseDht != 0);
     mOptionCheck_UseTrackers.Checked              = (mOptions.mUseTrackers != 0);
     mOptionCheck_CheckForBuild.Checked            = (mOptions.mCheckForLatestBuild != 0);
     mOptionCheck_StopOnCompletionTorrents.Checked = (mOptions.mStopOnCompletion != 0);
     mEditbox_MaxUploadRate.Text = (mOptions.mMaxUploadRate / 1024).ToString();
     mEditbox_ListenPort.Text    = DllInterface.GetListenerPort().ToString();
 }
Пример #2
0
 private void mEditbox_ListenPort_Leave(object sender, EventArgs e)
 {
     try
     {
         mEditbox_ListenPort.Text = Convert.ToUInt16(mEditbox_ListenPort.Text).ToString();
     }
     catch
     {
         MessageBox.Show("You can only type a number here (0-65535). You should use a port number higher than 1024.");
         mEditbox_ListenPort.Text = DllInterface.GetListenerPort().ToString();
         mEditbox_ListenPort.Focus();
     }
 }