private void MessagesForm_ANSUpdate(object sender) { int iSel = -1; bool bRes = false; iSel = SelectedUsersList.Selected; if (iSel > -1) { bRes = InfiniumMessages.FillSelectedUsers(SelectedUsersList.Items[iSel].UserID); } else { InfiniumMessages.FillSelectedUsers(iSel); } SelectedUsersList.InitializeItems(); if (iSel > -1) { if (bRes) { SelectedUsersList.Selected = iSel; } else { SelectedUsersList.SelectOnly(iSel); } } UsersList.Top = 159; UsersList.Height = UsersList.Parent.Height - UsersList.Top; }
public MessagesForm(ref Form tTopForm) { InitializeComponent(); Thread T = new Thread(delegate() { SplashWindow.CreateCoverSplash(true, (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2, (Screen.PrimaryScreen.WorkingArea.Width - this.Width) / 2, 503, 1014); }); T.Start(); while (!SplashWindow.bSmallCreated) { ; } TopForm = tTopForm; InfiniumMessages = new InfiniumMessages(); UsersList.ItemsDataTable = InfiniumMessages.UsersDataTable; UsersList.InitializeItems(); InfiniumMessages.FillSelectedUsers(-1); SelectedUsersList.ItemsDataTable = InfiniumMessages.SelectedUsersDataTable; SelectedUsersList.InitializeItems(); MessagesContainer.UsersDataTable = InfiniumMessages.FullUsersDataTable; MessagesContainer.CurrentUserID = Security.CurrentUserID; if (InfiniumMessages.SelectedUsersDataTable.Rows.Count > 0) { UsersList.Top = 159; UsersList.Height = UsersList.Parent.Height - UsersList.Top; SelectedUsersList.Selected = 0; InfiniumMessages.FillMessages(SelectedUsersList.Items[0].UserID); MessagesContainer.ItemsDataTable = InfiniumMessages.MessagesDataTable; MessagesContainer.InitializeItems(); } else { UsersList.Top = 0; UsersList.Height = UsersList.Parent.Height; UsersList.Selected = 0; InfiniumMessages.FillMessages(UsersList.Items[0].UserID); MessagesContainer.ItemsDataTable = InfiniumMessages.MessagesDataTable; MessagesContainer.InitializeItems(); } bC = true; }