Esempio n. 1
0
        private void AvChatUc_OnDial(object sender, AvChatEventArgs args)
        {
            if (chatType == ChatTypeE.OnlineClient)
            {
                if (cbAudienceType.SelectedIndex < 2 || UserID == Ap.CurrentUserID)
                {
                    return;
                }
            }
            else if (cbAudienceType.SelectedIndex != 0)
            {
                return;
            }

            if (Ap.CurrentUser.IsGuest || UserRank == "Guest")
            {
                ChatClient.Write(chatType, ChatMessageTypeE.Warning, chatType, "Not allowed for guest", 0);
                return;
            }

            if (!AvPlayer.IsFlash8Installed())
            {
                if (MessageForm.Confirm(this.ParentForm, MsgE.ConfirmFlashInstall) == DialogResult.Yes)
                {
                    System.Diagnostics.Process.Start(Msg.GetMsg(MsgE.InfoFlashUrl));
                }
                return;
            }

            ChatMessageEventArgs chatMessage = new ChatMessageEventArgs();

            chatMessage.ChatType = chatType;
            chatMessage.Type     = ChatMessageTypeE.Inprogress;
            //chatMessage.Message = "Calling " + UserName + "...";
            chatMessage.Message = "Connecting to chat server" + "...";
            AddLine(chatMessage);
            AvPlayer.InitializeChat(UserID, UserName, args.ChatType, chatType);
        }