예제 #1
0
파일: frmMain.cs 프로젝트: yukseljunk/wps
        private void btnPublish_Click(object sender, EventArgs e)
        {
            var posts = new List<Post>();
            foreach (ListViewItem selectedItem in lvItems.SelectedItems)
            {
                var postId = selectedItem.SubItems[PostIdColumnIndex].Text;
                int postIdNumeric;
                if (!Int32.TryParse(postId, out postIdNumeric))
                {
                    continue;
                }
                if (!string.IsNullOrEmpty(postId))
                {
                    posts.Add(new Post()
                    {
                        Id = postId,
                        Title = selectedItem.SubItems[3].Text
                    });
                }
            }
            if (posts.Count == 0)
            {
                MessageBox.Show("Select the items already inserted as draft, to publish them");
                return;
            }

            var frmPublish = new frmPublish();
            frmPublish.Posts = posts;
            frmPublish.ShowDialog();
        }
예제 #2
0
파일: frmMain.cs 프로젝트: yukseljunk/wps
        private void publishToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            if (!_blogSelected)
            {
                MessageBox.Show("First connect to blog from File>Connect!");
                return;
            }

            var frmPublish = new frmPublish();
            frmPublish.ShowDialog();
        }