Пример #1
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     if (_fb != null)
     {
         _fb.CancelAsync();
     }
 }
Пример #2
0
        private void btnUpload_Click(object sender, EventArgs e)
        {
            //Do uploading
            if (btnUpload.Tag.ToString() == "0")
            {
                txtMessage.Enabled = false;

                btnUpload.Text = GlobalSetting.LangPack.Items["frmFacebook.btnUpload._Cancel"];
                btnUpload.Tag  = 1;
                UploadPhoto();
            }
            else if (btnUpload.Tag.ToString().Length == 15)
            {
                string photoLink = "https://www.facebook.com/photo.php?fbid=" + btnUpload.Tag.ToString();
                System.Diagnostics.Process.Start(photoLink);
            }
            else //Do cancellation
            {
                txtMessage.Enabled = true;
                btnUpload.Text     = GlobalSetting.LangPack.Items["frmFacebook.btnUpload._Upload"];
                btnUpload.Tag      = 0;
                lblStatus.Text     = string.Format(GlobalSetting.LangPack.Items["frmFacebook._StatusBegin"],
                                                   btnUpload.Text);

                if (_fb != null)
                {
                    _fb.CancelAsync();
                }
            }
        }