private void LightNewsContainer_EditNewsClicked(object sender, int NewsID) { PhantomForm PhantomForm = new PhantomForm(); PhantomForm.Show(); AddNewsForm AddNewsForm = new AddNewsForm(ref LightNews, LightNews.GetThisNewsSenderTypeID(NewsID), LightNews.GetThisNewsHeaderText(NewsID), LightNews.GetThisNewsBodyText(NewsID), NewsID, LightNews.GetThisNewsDateTime(NewsID), ref TopForm); TopForm = AddNewsForm; AddNewsForm.ShowDialog(); PhantomForm.Close(); PhantomForm.Dispose(); TopForm = null; if (AddNewsForm.Canceled) { return; } Thread T = new Thread(delegate() { SplashWindow.CreateCoverSplash(LightNewsContainer.Top, LightNewsContainer.Left, LightNewsContainer.Height, LightNewsContainer.Width); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } LightNews.ReloadNews(LightNewsContainer.NewsCount); LightNews.ReloadComments(); LightNews.ReloadAttachments(); LightNewsContainer.NewsDataTable = LightNews.NewsDataTable.Copy(); LightNewsContainer.CommentsDT = LightNews.CommentsDataTable.Copy(); LightNewsContainer.AttachsDT = LightNews.AttachmentsDataTable.Copy(); LightNewsContainer.CreateNews(); bC = true; }
private void AddNewsButton_Click(object sender, EventArgs e) { PhantomForm PhantomForm = new PhantomForm(); PhantomForm.Show(); AddNewsForm AddNewsForm = new AddNewsForm(ref LightNews, ref TopForm); TopForm = AddNewsForm; AddNewsForm.ShowDialog(); PhantomForm.Close(); PhantomForm.Dispose(); TopForm = null; if (AddNewsForm.Canceled) { return; } Thread T = new Thread(delegate() { SplashWindow.CreateCoverSplash(LightNewsContainer.Top, LightNewsContainer.Left, LightNewsContainer.Height, LightNewsContainer.Width); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } LightNews.ReloadNews(20);//default LightNews.ReloadComments(); LightNews.ReloadAttachments(); LightNewsContainer.NewsDataTable = LightNews.NewsDataTable.Copy(); LightNewsContainer.CommentsDT = LightNews.CommentsDataTable.Copy(); LightNewsContainer.AttachsDT = LightNews.AttachmentsDataTable.Copy(); LightNewsContainer.CreateNews(); LightNewsContainer.ScrollToTop(); LightNewsContainer.Focus(); bC = true; }