Exemplo n.º 1
0
        private async void UserContext_UsersBanChanged(object sender, ItemsEventArgs <IUser> e)
        {
            foreach (var item in e.Items)
            {
                if (item.ID == this.cremaHost.UserID && item.Path != string.Empty)
                {
                    await this.Dispatcher.InvokeAsync(() =>
                    {
                        if (this.IsActive == false)
                        {
                            FlashWindowUtility.FlashWindow(this);
                        }
                        AppMessageBox.Show(item.BanInfo.Comment, Properties.Resources.Message_BannedByAdministrator);
                    });

                    break;
                }
            }
        }
Exemplo n.º 2
0
        private void UserContext_UsersKicked(object sender, ItemsEventArgs <IUser> e)
        {
            var userID   = this.cremaHost.UserID;
            var userIDs  = e.Items.Select(item => item.ID).ToArray();
            var comments = e.MetaData as string[];

            this.Dispatcher.InvokeAsync(() =>
            {
                for (var i = 0; i < userIDs.Length; i++)
                {
                    if (userIDs[i] == userID)
                    {
                        if (this.IsActive == false)
                        {
                            FlashWindowUtility.FlashWindow(this);
                        }
                        AppMessageBox.Show(comments[i], Properties.Resources.Message_KickedByAdministrator);
                        break;
                    }
                }
            });
        }