Пример #1
0
        private void CoderBlogContainer_EditNewsClicked(object sender, int NewsID)
        {
            PhantomForm PhantomForm = new PhantomForm();

            PhantomForm.Show();

            AddBlogNewsForm AddBlogNewsForm = new AddBlogNewsForm(ref CoderBlog, CoderBlog.GetThisNewsSenderTypeID(NewsID),
                                                                  CoderBlog.GetThisNewsHeaderText(NewsID),
                                                                  CoderBlog.GetThisNewsBodyText(NewsID),
                                                                  NewsID, CoderBlog.GetThisNewsDateTime(NewsID), ref TopForm);

            TopForm = AddBlogNewsForm;

            AddBlogNewsForm.ShowDialog();

            PhantomForm.Close();
            PhantomForm.Dispose();

            TopForm = null;

            if (AddBlogNewsForm.Canceled)
            {
                return;
            }

            Thread T = new Thread(delegate()
            {
                SplashWindow.CreateCoverSplash(CoderBlogContainer.Top, CoderBlogContainer.Left,
                                               CoderBlogContainer.Height, CoderBlogContainer.Width);
            });

            T.Start();

            while (!SplashWindow.bSmallCreated)
            {
                ;
            }


            CoderBlog.ReloadNews(CoderBlogContainer.NewsCount);
            CoderBlog.ReloadComments();
            CoderBlog.ReloadAttachments();
            CoderBlogContainer.NewsDataTable = CoderBlog.BlogNewsDataTable.Copy();
            CoderBlogContainer.CommentsDT    = CoderBlog.CommentsDataTable.Copy();
            CoderBlogContainer.AttachsDT     = CoderBlog.AttachmentsDataTable.Copy();
            CoderBlogContainer.CreateNews();

            bC = true;
        }
Пример #2
0
        private void AddBlogNewsButton_Click(object sender, EventArgs e)
        {
            PhantomForm PhantomForm = new PhantomForm();

            PhantomForm.Show();

            AddBlogNewsForm AddBlogNewsForm = new AddBlogNewsForm(ref CoderBlog, ref TopForm);

            TopForm = AddBlogNewsForm;

            AddBlogNewsForm.ShowDialog();

            PhantomForm.Close();
            PhantomForm.Dispose();

            TopForm = null;

            if (AddBlogNewsForm.Canceled)
            {
                return;
            }

            Thread T = new Thread(delegate()
            {
                SplashWindow.CreateCoverSplash(CoderBlogContainer.Top, CoderBlogContainer.Left,
                                               CoderBlogContainer.Height, CoderBlogContainer.Width);
            });

            T.Start();

            while (!SplashWindow.bSmallCreated)
            {
                ;
            }


            CoderBlog.ReloadNews(20);//default
            CoderBlog.ReloadComments();
            CoderBlog.ReloadAttachments();
            CoderBlogContainer.NewsDataTable = CoderBlog.BlogNewsDataTable.Copy();
            CoderBlogContainer.CommentsDT    = CoderBlog.CommentsDataTable.Copy();
            CoderBlogContainer.AttachsDT     = CoderBlog.AttachmentsDataTable.Copy();
            CoderBlogContainer.CreateNews();
            CoderBlogContainer.ScrollToTop();
            CoderBlogContainer.Focus();

            bC = true;
        }