Exemplo n.º 1
0
        private void btnPost_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            //this.Enabled = false;
            foreach (Control et in this.Controls)
            {
                et.Enabled = false;
            }
            //text = new tumblr.Text();
            tum = new tumblr();
            //string s;
            DataRowView drv = (DataRowView)cbAcc.SelectedValue;

            string acc = (string)drv["account"];
            string email = (string)drv["email"];
            string group = (string)drv["group"];
            string password = "";
            try
            {
                password = Program.data.rox((string)drv["password"]);
            }
            catch
            {
                password = "";
            }
            string title = "";
            string body = "";

            title = txtTitle.Text;
            body = txtBody.Text.Replace("\r\n", " ");
            text.Email = email;
            text.Password = password;
            text.Group = group;
            text.Title = title;
            text.Body = body;
            if (((body.Length > 0) || (title.Length > 0)) && (email.Length > 0) && (password.Length > 0))
            {
                //notice = new notify();
                //notice.Left = Left + (int)(((Width - notice.Width) / 2));
                //notice.Top = Top + (int)(((Height - notice.Height) / 2));
                //notice.Show(this);
                tumblr.apostText ap = new tumblr.apostText(tum.postText);

                IAsyncResult result = ap.BeginInvoke(text, new AsyncCallback(CallbackMethod), ap);
                //s = Convert.ToString(tum.postText(text)); //email, password, title, body));
            }
            else
            {
                //this.Enabled = true;
                foreach (Control et in this.Controls)
                {
                    et.Enabled = true;
                }
                this.Cursor = Cursors.Default;
                MessageBox.Show(this, "Something went wrong setting all of the parameters for posting. Please check the account details and fields.", "Error - WinTumblr", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        private void btnPost_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            //this.Enabled = false;
            foreach (Control et in this.Controls)
            {
                et.Enabled = false;
            }
            tum = new tumblr();
            //tum.TumblrEvent += new tumblr.TumblrEventHandler(TumblrPost);
            //string s;
            DataRowView drv = (DataRowView)cbAcc.SelectedValue;

            string acc = (string)drv["account"];
            string email = (string)drv["email"];
            string group = (drv["group"] != DBNull.Value ? (string)drv["group"] : "");
            string password = "";
            try
            {
                password = Program.data.rox((string)drv["password"]);
            }
            catch
            {
                password = "";
            }
            string Nam = "";
            string Url = "";
            string Desc = "";

            Nam = txtName.Text;
            Url = txtURL.Text;
            Desc = txtDescription.Text.Replace("\r\n", " ");
            link.Email = email;
            link.Password = password;
            link.Group = group;
            link.Name = Nam;
            link.Url = Url;
            link.Description = Desc;
            if ((Url.Length > 0) && (email.Length > 0) && (password.Length > 0))
            {
                tumblr.apostLink ap = new tumblr.apostLink(tum.postLink);

                IAsyncResult result = ap.BeginInvoke(link, new AsyncCallback(CallbackMethod), ap);
                //s = Convert.ToString(tum.postLink(link));
            }
            else
            {
                //this.Enabled = true;
                foreach (Control et in this.Controls)
                {
                    et.Enabled = true;
                }
                this.Cursor = Cursors.Default;
                MessageBox.Show(this, "Something went wrong setting all of the parameters for posting. Please check the account details and fields.", "Error - WinTumblr", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 3
0
        private void btnPost_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            //this.Enabled = false;
            foreach (Control et in this.Controls)
            {
                et.Enabled = false;
            }
            tum = new tumblr();
            //tum.TumblrEvent += new tumblr.TumblrEventHandler(TumblrPost);
            //string s;
            DataRowView drv = (DataRowView)cbAcc.SelectedValue;

            string acc = (string)drv["account"];
            string email = (string)drv["email"];
            string group = (string)drv["group"];
            string password = "";
            try
            {
                password = Program.data.rox((string)drv["password"]);
            }
            catch
            {
                password = "";
            }
            string title = "";
            string conv = "";

            title = txtTitle.Text;
            conv = txtDialogue.Text;
            chat.Email = email;
            chat.Password = password;
            chat.Group = group;
            chat.Title = title;
            chat.TheChat = conv;
            if ((conv.Length > 0) && (email.Length > 0) && (password.Length > 0) && (txtDialogue.ForeColor != Color.LightGray))
            {
                tumblr.apostChat ap = new tumblr.apostChat(tum.postChat);

                IAsyncResult result = ap.BeginInvoke(chat, new AsyncCallback(CallbackMethod), ap);
                //s = Convert.ToString(tum.postChat(chat));
            }
            else
            {
                //this.Enabled = true;
                foreach (Control et in this.Controls)
                {
                    et.Enabled = true;
                }
                this.Cursor = Cursors.Default;
                MessageBox.Show(this, "Something went wrong setting all of the parameters for posting. Please check the account details and fields.", "Error - WinTumblr", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 4
0
        private void btnPost_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            //this.Enabled = false;
            foreach (Control et in this.Controls)
            {
                et.Enabled = false;
            }
            tum = new tumblr();
            //tum.TumblrEvent += new tumblr.TumblrEventHandler(TumblrPost);
            //string s;
            DataRowView drv = (DataRowView)cbAcc.SelectedValue;

            string acc = (string)drv["account"];
            string email = (string)drv["email"];
            string group = (string)drv["group"];
            string password = "";
            try
            {
                password = Program.data.rox((string)drv["password"]);
            }
            catch
            {
                password = "";
            }
            string TheQuote = "";
            string Source = "";

            TheQuote = txtQuote.Text;
            Source = txtSource.Text.Replace("\r\n", " ");
            quote.Email = email;
            quote.Password = password;
            quote.Group = group;
            quote.TheQuote = TheQuote;
            quote.Source = Source;
            if ((TheQuote.Length > 0) && (email.Length > 0) && (password.Length > 0))
            {
                tumblr.apostQuote ap = new tumblr.apostQuote(tum.postQuote);

                IAsyncResult result = ap.BeginInvoke(quote, new AsyncCallback(CallbackMethod), ap);
                //s = Convert.ToString(tum.postQuote(quote));
            }
            else
            {
                //this.Enabled = true;
                foreach (Control et in this.Controls)
                {
                    et.Enabled = true;
                }
                this.Cursor = Cursors.Default;
                MessageBox.Show(this, "Something went wrong setting all of the parameters for posting. Please check the account details and fields.", "Error - WinTumblr", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 5
0
        private void btnValidate_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            btnValidate.Enabled = false;
            tumblr.Account account = new tumblr.Account();
            tum = new tumblr();

            account.Email = txtEmail.Text;
            account.Password = txtPassword.Text;
            if ((account.Email.Length > 0) && (account.Password.Length > 0))
            {
                tumblr.aAuthenticate aA = new tumblr.aAuthenticate(tum.Authenticate);

                IAsyncResult result = aA.BeginInvoke(account, new AsyncCallback(CallbackMethod), aA);
            }
            else
            {
                btnValidate.Enabled = true;
                this.Cursor = Cursors.Default;
                MessageBox.Show(this, "Something went wrong setting all of the parameters for posting. Please check the account details and fields.", "Error - WinTumblr", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 6
0
        private void btnPost_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            //this.Enabled = false;
            foreach (Control et in this.Controls)
            {
                et.Enabled = false;
            }
            tum = new tumblr();
            //tum.TumblrEvent += new tumblr.TumblrEventHandler(TumblrPost);
            //string s;
            DataRowView drv = (DataRowView)cbAcc.SelectedValue;

            string acc = (string)drv["account"];
            string email = (string)drv["email"];
            string group = (string)drv["group"];
            string password = "";
            try
            {
                password = Program.data.rox((string)drv["password"]);
            }
            catch
            {
                password = "";
            }
            string Src = "";
            string Dat = "";
            string Cap = "";
            string url = "";
            bool bContinue = true;

            Src = txtUrl.Text;
            Dat = txtFile.Text;
            Cap = txtCaption.Text.Replace("\r\n", " ");
            url = txtClickThroughUrl.Text;
            photo.Email = email;
            photo.Password = password;
            photo.Group = group;
            if (rbUrl.Checked)
            {
                photo.Source = Src;
            }
            else
            {
                try
                {
                    photo.Data = Dat;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(this, ex.Message, "Photo Post Error - WinTumblr", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    bContinue = false;
                }
            }
            photo.Caption = Cap;
            photo.ClickThroughUrl = url;
            if (bContinue && ((Src.Length > 0) || (Dat.Length > 0)) && (email.Length > 0) && (password.Length > 0))
            {
                tumblr.apostPhoto ap = new tumblr.apostPhoto(tum.postPhoto);

                IAsyncResult result = ap.BeginInvoke(photo, new AsyncCallback(CallbackMethod), ap);
                //s = Convert.ToString(tum.postPhoto(photo));
            }
            else
            {
                //this.Enabled = true;
                foreach (Control et in this.Controls)
                {
                    et.Enabled = true;
                }
                this.Cursor = Cursors.Default;
                if (bContinue)
                {
                    MessageBox.Show(this, "Something went wrong setting all of the parameters for posting. Please check the account details and fields.", "Error - WinTumblr", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 7
0
 public frmMore(tumblr.Account pAcc)
 {
     mAcc = pAcc;
     InitializeComponent();
 }