Alert() public méthode

public Alert ( ) : void
Résultat void
Exemple #1
0
        private void ClientReceiveMessage(ReceiveMessageEventArgs e)
        {
            if (e.RoomName != Name)
            {
                return;
            }

            switch (e.Type)
            {
            case MessageType.Common:
                AddMessage(e.MessageId, e.Time, e.Sender, e.Message);
                break;

            case MessageType.File:
                AddFileMessage(e.Time, e.Sender, e.FileId);
                break;
            }

            if (Name != mainViewModel.SelectedRoom.Name)
            {
                Updated = true;
            }

            mainViewModel.Alert();
        }
Exemple #2
0
        private void ClientReceiveMessage(object sender, ReceiveMessageEventArgs e)
        {
            if (e.RoomName != Name)
            {
                return;
            }

            Dispatcher.BeginInvoke(new Action <ReceiveMessageEventArgs>(args =>
            {
                var senderUser = MainViewModel.AllUsers.Single(uvm => uvm.Info.Nick == args.Sender);

                switch (args.Type)
                {
                case MessageType.Common:
                    AddMessage(args.MessageId, senderUser, args.Message);
                    break;

                case MessageType.File:
                    AddFileMessage(senderUser, (FileDescription)args.State);
                    break;
                }

                if (Name != MainViewModel.SelectedRoom.Name)
                {
                    Updated = true;
                }

                MainViewModel.Alert();
            }), e);
        }