Beispiel #1
0
        private void SubscribeEvents()
        {
            _joinToken = EventAggregatorManager.Instance.EventAggregator.GetEvent <JoinMeetingEvent>().Subscribe((argument) =>
            {
                if (string.IsNullOrEmpty(MeetingNumber))
                {
                    JoinError = "请输入课堂号!";
                    return;
                }

                ulong uint_meeting_number;
                if (ulong.TryParse(MeetingNumber, out uint_meeting_number))
                {
                    SDKError joinError = CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().Join(new JoinParam()
                    {
                        userType    = SDKUserType.SDK_UT_APIUSER,
                        apiuserJoin = new JoinParam4APIUser()
                        {
                            userName           = "******",
                            meetingNumber      = uint_meeting_number,
                            psw                = string.Empty,
                            hDirectShareAppWnd = new HWNDDotNet()
                            {
                                value = 0
                            },
                            isAudioOff           = false,
                            isDirectShareDesktop = false,
                            isVideoOff           = false,
                            participantId        = string.Empty,
                            toke4enfrocelogin    = string.Empty,
                            webinarToken         = string.Empty,
                        }
                    });

                    if (joinError == SDKError.SDKERR_SUCCESS)
                    {
                        MeetingView meetingView = new MeetingView();
                        meetingView.Show();
                    }
                    else
                    {
                        MessageBox.Show(joinError.ToString());
                    }
                }
                else
                {
                    JoinError = "请输入有效的课堂号!";
                }
            }, Prism.Events.ThreadOption.PublisherThread, true, filter => { return(filter.Target == Target.JoinMeetingViewModel); });
        }
Beispiel #2
0
        private void InitData()
        {
            JoinCommand = new DelegateCommand <CourseModel>((course) =>
            {
                ulong uint_meeting_number;
                if (!ulong.TryParse(course.MeetingNumber, out uint_meeting_number))
                {
                    MessageBox.Show("无效的课堂号!");
                    return;
                }
                ;

                if (course.HostId == App.UserModel.UserName)
                {
                    CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Add_CB_onLoginRet((loginStatus, accountInfo) =>
                    {
                        switch (loginStatus)
                        {
                        case LOGINSTATUS.LOGIN_IDLE:
                            break;

                        case LOGINSTATUS.LOGIN_PROCESSING:
                            break;

                        case LOGINSTATUS.LOGIN_SUCCESS:

                            SDKError joinError = CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().Join(new JoinParam()
                            {
                                userType       = SDKUserType.SDK_UT_NORMALUSER,
                                normaluserJoin = new JoinParam4NormalUser()
                                {
                                    hDirectShareAppWnd = new HWNDDotNet()
                                    {
                                        value = 0
                                    },
                                    isAudioOff           = false,
                                    isDirectShareDesktop = false,
                                    isVideoOff           = false,
                                    meetingNumber        = uint_meeting_number,
                                    participantId        = string.Empty,
                                    psw          = string.Empty,
                                    userName     = "******",
                                    webinarToken = string.Empty,
                                }
                            });

                            if (joinError == SDKError.SDKERR_SUCCESS)
                            {
                                MeetingView meetingView = new MeetingView();
                                meetingView.Show();
                            }
                            else
                            {
                                MessageBox.Show(joinError.ToString());
                            }



                            break;

                        case LOGINSTATUS.LOGIN_FAILED:
                            break;

                        default:
                            break;
                        }
                    });

                    SDKError loginError = CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().Login(new LoginParam()
                    {
                        loginType  = LoginType.LoginType_Email,
                        emailLogin = new LoginParam4Email()
                        {
                            bRememberMe = true,
                            password    = "******",
                            userName    = course.HostId,
                        }
                    });
                }
                else
                {
                    SDKError joinError = CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().Join(new JoinParam()
                    {
                        userType    = SDKUserType.SDK_UT_APIUSER,
                        apiuserJoin = new JoinParam4APIUser()
                        {
                            userName           = "******",
                            meetingNumber      = uint_meeting_number,
                            psw                = string.Empty,
                            hDirectShareAppWnd = new HWNDDotNet()
                            {
                                value = 0
                            },
                            isAudioOff           = false,
                            isDirectShareDesktop = false,
                            isVideoOff           = false,
                            participantId        = string.Empty,
                            toke4enfrocelogin    = string.Empty,
                            webinarToken         = string.Empty,
                        }
                    });

                    if (joinError == SDKError.SDKERR_SUCCESS)
                    {
                        MeetingView meetingView = new MeetingView();
                        meetingView.Show();
                    }
                    else
                    {
                        MessageBox.Show(joinError.ToString());
                    }
                }
            });

            CourseList = new ObservableCollection <CourseModel>();
            CourseList.Add(new CourseModel()
            {
                Duration      = "8:00 - 9:00",
                Name          = "语文",
                TeacherName   = "马云",
                MeetingNumber = "286683782",
                HostId        = "*****@*****.**",
                JoinCommand   = JoinCommand,
            });
            CourseList.Add(new CourseModel()
            {
                Duration      = "11:00 - 12:00",
                Name          = "数学",
                TeacherName   = "刘强东",
                MeetingNumber = "286683782",
                HostId        = "*****@*****.**",
                JoinCommand   = JoinCommand,
            });
            CourseList.Add(new CourseModel()
            {
                Duration      = "14:00 - 15:00",
                Name          = "生物",
                TeacherName   = "李海波",
                MeetingNumber = "286683782",
                HostId        = "*****@*****.**",
                JoinCommand   = JoinCommand,
            });
        }
Beispiel #3
0
        private void SubscribeEvents()
        {
            _cardSelectedToken = EventAggregatorManager.Instance.EventAggregator.GetEvent <CardSelectedEvent>().Subscribe((argument) =>
            {
                switch (argument.Argument.Category)
                {
                case Category.MainCard:
                    IsMainCardSelected    = true;
                    IsHistoryCardSelected = false;
                    break;

                case Category.HistoryCard:
                    IsMainCardSelected    = false;
                    IsHistoryCardSelected = true;
                    break;
                }
            }, ThreadOption.PublisherThread, true, filter => { return(filter.Target == Target.MainViewModel); });


            _startClassToken = EventAggregatorManager.Instance.EventAggregator.GetEvent <StartClassEvent>().Subscribe((argument) =>
            {
                RegisterCallbacks();

                CustomMeetingUI();

                StartHook();


                StartParam startParam = new StartParam()
                {
                    userType = SDKUserType.SDK_UT_NORMALUSER,
                };

                //StartParam4APIUser apiuserStart = new StartParam4APIUser()
                //{
                //    userID = "704311",
                //    userToken = "Izi6atSDBiwtIqk3GQX9txjxjj8SZLIa6s7v",
                //    userName = "******",
                //    meetingNumber = 3398415968,

                //};

                StartParam4NormalUser normalUser = new StartParam4NormalUser()
                {
                    meetingNumber = 3398415968,
                };

                startParam.normaluserStart = normalUser;



                SDKError error = SdkWrap.Instacne.Start(startParam);

                if (error == SDKError.SDKERR_SUCCESS)
                {
                    EventAggregatorManager.Instance.EventAggregator.GetEvent <WindowHideEvent>().Publish(new EventArgument()
                    {
                        Target = Target.MainView,
                    });

                    _meetingView = new MeetingView();
                    _meetingView.Show();
                }
                else
                {
                    MessageBox.Show(error.ToString());
                }
            }, ThreadOption.PublisherThread, true, filter => { return(filter.Target == Target.MainViewModel); });
        }