Пример #1
0
        public async Task ShowViewAsync(ParticipantView view)
        {
            Log.Logger.Debug($"ViewLayout=>phoneId={view.Participant.PhoneId}, name={view.Participant.Name}, type={view.ViewType}, hwnd={view.Hwnd}");
            var viewFrameVisible = ViewFrameList.FirstOrDefault(viewFrame => viewFrame.Hwnd == view.Hwnd);

            if (viewFrameVisible != null)
            {
                viewFrameVisible.IsOpened   = true;
                viewFrameVisible.Visibility = Visibility.Visible;
                viewFrameVisible.PhoneId    = view.Participant.PhoneId;


                var attendee =
                    GlobalData.Instance.Classrooms.FirstOrDefault(
                        classroom => classroom.SchoolRoomNum == view.Participant.PhoneId);

                string displayName = string.Empty;
                if (!string.IsNullOrEmpty(attendee?.SchoolRoomName))
                {
                    displayName = attendee.SchoolRoomName;
                }

                viewFrameVisible.ViewName = view.ViewType == 1
                    ? displayName
                    : $"(课件){displayName}";

                viewFrameVisible.ViewType  = view.ViewType;
                viewFrameVisible.ViewOrder = ViewFrameList.Max(viewFrame => viewFrame.ViewOrder) + 1;
            }
            await LaunchLayout();
        }
Пример #2
0
        public async Task ShowViewAsync(ParticipantView view)
        {
            Log.Logger.Debug(
                $"【create view】:hwnd={view.Hwnd}, phoneId={view.Participant.PhoneId}, viewType={view.ViewType}");
            var viewFrameVisible = ViewFrameList.FirstOrDefault(viewFrame => viewFrame.Hwnd == view.Hwnd);

            if (viewFrameVisible != null)
            {
                // LOG return a handle which can not be found in handle list.

                viewFrameVisible.IsOpened   = true;
                viewFrameVisible.Visibility = Visibility.Visible;
                viewFrameVisible.PhoneId    = view.Participant.PhoneId;

                var    attendee    = _attendees.FirstOrDefault(userInfo => userInfo.GetNube() == view.Participant.PhoneId);
                string displayName = string.Empty;
                if (!string.IsNullOrEmpty(attendee?.Name))
                {
                    displayName = attendee.Name;
                }

                viewFrameVisible.ViewName = view.ViewType == 1
                    ? displayName
                    : $"(共享){displayName}";

                viewFrameVisible.ViewType  = view.ViewType;
                viewFrameVisible.ViewOrder = ViewFrameList.Max(viewFrame => viewFrame.ViewOrder) + 1;
            }

            await LaunchLayout();
        }
Пример #3
0
        //private async Task GotoDefaultMode()
        //{
        //    MeetingMode = MeetingMode.Interaction;
        //    ResetAsAutoLayout();

        //    await LaunchLayout();
        //}

        //private void MakeNonCreatorViewsInvisible()
        //{
        //    ViewFrameList.ForEach(viewFrame =>
        //    {
        //        if (viewFrame.PhoneId != _sdkService.TeacherPhoneId)
        //            viewFrame.Visibility = Visibility.Collapsed;
        //    });
        //}

        private void ResetFullScreenView(ParticipantView toBeClosedView)
        {
            if ((FullScreenView != null) && (FullScreenView.PhoneId == toBeClosedView.Participant.PhoneId) &&
                (FullScreenView.ViewType == toBeClosedView.ViewType))
            {
                FullScreenView = null;
            }
        }
        private void _sdkService_ViewCreateEvent(ParticipantView speakerView)
        {
            var targetAttendee = AttendeeItems.FirstOrDefault(
                attendee => attendee.Id == speakerView.Participant.PhoneId && attendee.Hwnd == speakerView.Hwnd);

            if (targetAttendee != null)
            {
                targetAttendee.Content = CancelSpeaking;
            }
        }
Пример #5
0
        public async Task HideViewAsync(ParticipantView view)
        {
            ResetFullScreenView(view);

            var viewFrameInvisible = ViewFrameList.FirstOrDefault(viewFrame => viewFrame.Hwnd == view.Hwnd);

            if (viewFrameInvisible != null)
            {
                // LOG return a handle which can not be found in handle list.

                viewFrameInvisible.IsOpened   = false;
                viewFrameInvisible.Visibility = Visibility.Collapsed;
            }

            await LaunchLayout();
        }
Пример #6
0
        public void HideExtendedViewAsync(ParticipantView view)
        {
            if (view?.Participant == null || ExtenedViewFrameList == null)
            {
                ExtentdedLaunchLayout();
                return;
            }
            var viewFrameInvisible =
                ExtenedViewFrameList.FirstOrDefault(viewFrame => viewFrame.PhoneId == view.Participant.PhoneId);

            if (viewFrameInvisible != null)
            {
                // LOG return a handle which can not be found in handle list.
                viewFrameInvisible.IsOpened   = false;
                viewFrameInvisible.Visibility = Visibility.Collapsed;
                viewFrameInvisible.PhoneId    = null;
                // ExtenedViewFrameList.Remove(viewFrameInvisible);
            }
        }
Пример #7
0
        public async Task HideViewAsync(ParticipantView view)
        {
            Log.Logger.Debug(
                $"【close view】:hwnd={view.Hwnd}, phoneId={view.Participant.PhoneId}, viewType={view.ViewType}");

            ResetFullScreenView(view);

            var viewFrameInvisible = ViewFrameList.FirstOrDefault(viewFrame => viewFrame.Hwnd == view.Hwnd);

            if (viewFrameInvisible != null)
            {
                // LOG return a handle which can not be found in handle list.


                viewFrameInvisible.IsOpened   = false;
                viewFrameInvisible.Visibility = Visibility.Collapsed;
            }

            await LaunchLayout();
        }