Beispiel #1
0
        private void AddEntry_Click(object sender, System.EventArgs e)
        {
            addentry dlg = new addentry();

            if (dlg.ShowDialog() == DialogResult.OK &&
                dlg.Entry.Length > 0)
            {
                // now add this to the feed.

                BloggerEntry entry = new BloggerEntry();

                entry.Content.Content = dlg.Entry;
                entry.Content.Type    = "html";
                entry.Title.Text      = dlg.EntryTitle;


                string userName = this.UserName.Text;
                string passWord = this.Password.Text;

                BloggerService service = new BloggerService("BloggerSampleApp.NET");

                if (userName != null && userName.Length > 0)
                {
                    service.Credentials = new GDataCredentials(userName, passWord);
                }

                service.Insert(new Uri(this.feedUri), entry);

                RefreshFeed(this.feedUri);
            }
        }
Beispiel #2
0
        private void AddEntry_Click(object sender, System.EventArgs e)
        {
            addentry dlg = new addentry();
            if (dlg.ShowDialog() == DialogResult.OK &&
                dlg.Entry.Length > 0)
            {
                // now add this to the feed.

                BloggerEntry entry = new BloggerEntry();

                entry.Content.Content = dlg.Entry;
                entry.Content.Type = "html";
                entry.Title.Text = dlg.EntryTitle;
                string sLables = dlg.txtLabel.Text;
                string[] arrLabels = sLables.Split(',');
                for(int i=0;i<arrLabels.Length;i++)
                {
                    AtomCategory cat = new AtomCategory();
                    cat.Scheme = new Uri("http://www.blogger.com/atom/ns#");
                    cat.Term = arrLabels[i].ToString();
                    entry.Categories.Add(cat);
                }

                string userName =    this.UserName.Text;
                string passWord =    this.Password.Text;

                BloggerService service = new BloggerService("ChessBank");

                if (userName != null && userName.Length > 0)
                {
                    service.Credentials = new GDataCredentials(userName, passWord);
                }

                service.Insert(new Uri(this.feedUri), entry);

                RefreshFeed(this.feedUri);
            }
        }
        private void AddEntry_Click(object sender, System.EventArgs e)
        {
            addentry dlg = new addentry();
            if (dlg.ShowDialog() == DialogResult.OK &&
                dlg.Entry.Length > 0) 
            {
                // now add this to the feed.

                BloggerEntry entry = new BloggerEntry();

                entry.Content.Content = dlg.Entry;
                entry.Content.Type = "html"; 
                entry.Title.Text = dlg.EntryTitle;


                string userName =    this.UserName.Text;
                string passWord =    this.Password.Text;

                BloggerService service = new BloggerService("BloggerSampleApp.NET");

                if (userName != null && userName.Length > 0)
                {
                    service.Credentials = new GDataCredentials(userName, passWord);
                }

                service.Insert(new Uri(this.feedUri), entry); 

                RefreshFeed(this.feedUri);
            }
        }