Beispiel #1
0
        public Form1()
        {
            //filepath���ļ�·�������Ҫ�ϴ��ļ�Ҫ�������ֵΪ�ļ�·��
            InitializeComponent();

            this.linkLabel1.Click += new EventHandler(delegate(object o, EventArgs args)
            {
                System.Diagnostics.Process.Start(this.linkLabel1.Text);
            });

            this.richtxtWeiboStatus.AllowDrop = true;
            this.richtxtWeiboStatus.DragEnter += new DragEventHandler(richtxtWeiboStatus_DragEnter);

            SinaBusiness.Config.SConfig sc = new SinaBusiness.Config.SConfig();
            this.Text = "�˺�:" + sc.UserName;
            this.Height = 150;
            this.picBoxRequestLoading.Visible = false;
            this.picBoxSendLoading.Visible = false;
            IsVisibleSendWebboControl(false);

            this.richtxtWeiboStatus.TextChanged += new EventHandler(delegate(object o, EventArgs args)
            {
                int onlyNum=140 - richtxtWeiboStatus.Text.Trim().Length;
                grpSendWeibo.Text="Only "+onlyNum.ToString();
                if (!isShow)
                {
                    if (!string.IsNullOrEmpty(richtxtWeiboStatus.Text.Trim()))
                    {
                        this.btnSendWeiBo.Visible = true;
                        this.button1.Visible = false;
                    }
                    else
                    {
                        this.btnSendWeiBo.Visible = false;
                        this.button1.Visible = true;
                    }
                }
            });
            this.btnUploadPicture.Click += new EventHandler(btnUploadPicture_Click);
            this.btnPerv.Click += new EventHandler(btnPerv_Click);
            this.btnNext.Click += new EventHandler(btnNext_Click);
            this.pictureBox1.Click += new EventHandler(delegate(object o, EventArgs args)
            {
                if (this.pictureBox1.Image!=null)
                {
                    ShowPictureFromImageObject(this.pictureBox1.Image);
                }
            });
            this.btnSendWeiBo.Click += new EventHandler(btnSendWeiBo_Click);
            bgSend = this.GetNewBackgroundWorkerObject();
            bgSend.DoWork += new DoWorkEventHandler(delegate(object o, DoWorkEventArgs args)
            {

                if (string.IsNullOrEmpty(FilePath))
                {
                    SendWeibo((string)args.Argument);
                }
                else
                {
                    SendWeibo((string)args.Argument, FilePath);
                }
            });
            bgSend.RunWorkerCompleted += new RunWorkerCompletedEventHandler(delegate(object o, RunWorkerCompletedEventArgs args)
            {
                IsVisibleControl(this.picBoxSendLoading, false);
                this.lblSendWeiboTips.Text = "Finish!!!";
                this.pictureBox1.Image = null;
                this.FilePath = string.Empty;
                this.richtxtWeiboStatus.Text = "";
                this.btnSendWeiBo.Enabled = true ;
                this.btnUploadPicture.Enabled = true;
            });
            this.btnLoginout.Click += new EventHandler(btnLoginout_Click);

            bindEventPictureBox();
            bindLinkClickRichTextBox();
        }
Beispiel #2
0
 void btnLoginout_Click(object sender, EventArgs e)
 {
     SinaBusiness.Config.SConfig s = new SinaBusiness.Config.SConfig();
     s.DoNotAutoLogin();
     this.Close();
 }