Пример #1
0
        void UserVideo_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                if (capture == null & flg == false)
                {
                    if (MyVidType == "Me")
                    {
                        filters = new Filters();

                        cnvUserVideo.Visibility = Visibility.Visible;
                        m_DelSendImage          = new DelSendImage(SetMyImage);

                        try
                        {
                            if (filters.VideoInputDevices.Count > 1)
                            {
                                lstVideoInput = new List <string>();
                                lstVideoInput = filters.VideoInputDevices.GetVideoInputDevices();

                                objShowVideo = new ShowVideoInputs(lstVideoInput);
                                objShowVideo.EntSelectedDevice += new ShowVideoInputs.delSelectedDevice(objShowVideo_EntSelectedDevice);
                                objShowVideo.Show();
                            }
                            else if (filters.VideoInputDevices.Count == 0)
                            {
                            }
                            else
                            {
                                InitCapture("Low", 0);
                            }
                        }
                        catch (Exception ex)
                        {
                            VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "UserVideo_Loaded", "ctlUserVideo.xaml.cs");
                        }
                    }
                    else
                    {
                        picUserVideo.Visibility = Visibility.Visible;

                        m_DelSendImage = new DelSendImage(SetOtherImage);
                    }
                }
                else if (flg)
                {
                    double[] winXY = new double[2];
                    winXY = capture.PreviewWidowTag();

                    if (winXY[0] != 0 & winXY[1] != 0)
                    {
                        if (MyVidType == "Me")
                        {
                            flg = false;
                            capture.showVideo();
                        }
                    }
                    else
                    {
                        capture.hideVideo();
                        flg = true;
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "UserVideo_Loaded", "ctlUserVideo.xaml.cs");
            }
        }
Пример #2
0
        void UserVideo_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                
                if (capture == null & flg == false)
                {
                    if (MyVidType == "Me")
                    {

                        filters = new Filters();

                        cnvUserVideo.Visibility = Visibility.Visible;
                        m_DelSendImage = new DelSendImage(SetMyImage);

                        try
                        {
                            if (filters.VideoInputDevices.Count > 1)
                            {

                                lstVideoInput = new List<string>();
                                lstVideoInput = filters.VideoInputDevices.GetVideoInputDevices();

                                objShowVideo = new ShowVideoInputs(lstVideoInput);
                                objShowVideo.EntSelectedDevice += new ShowVideoInputs.delSelectedDevice(objShowVideo_EntSelectedDevice);
                                objShowVideo.Show();
                            }
                            else if (filters.VideoInputDevices.Count == 0)
                            {
                                
                            }
                            else
                            {
                                InitCapture("Low", 0);
                            }
                        }
                        catch (Exception ex)
                        {
                            VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "UserVideo_Loaded", "ctlUserVideo.xaml.cs");             
                        }
                    }
                    else
                    {
                        picUserVideo.Visibility = Visibility.Visible;

                        m_DelSendImage = new DelSendImage(SetOtherImage);

                    }
                }
                else if (flg)
                {
                    double[] winXY = new double[2];
                    winXY = capture.PreviewWidowTag();

                    if (winXY[0] != 0 & winXY[1] != 0)
                    {
                        if (MyVidType == "Me")
                        {
                            flg = false;
                            capture.showVideo();
                        }
                    }
                    else
                    {
                        capture.hideVideo();
                        flg = true;
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "UserVideo_Loaded", "ctlUserVideo.xaml.cs");             
            }
	      }
Пример #3
0
        void cbMenu_DropDownClosed(object sender, EventArgs e)
        {
            try
            {
                if (cbMenu.SelectedItem != null && cbMenu.SelectedItem.ToString() == "Full Screen")
                {
                    try
                    {
                        if (FullScreenMe || FullScreenOther)
                        {
                            MessageBox.Show("Video is all ready running in Full Screen");
                        }
                        else
                        {
                            if (MyVidType == "Me")
                            {
                                FullScreenMe = true;
                            }
                            else
                            {
                                FullScreenOther = true;
                            }

                            FSUname = lblUName.Content.ToString();

                            Tfs       = new TestFullScreen();
                            Tfs.Title = lblUName.Content.ToString() + " Video In Full Screen Mode";
                            Tfs.Show();

                            Tfs.Closed += new EventHandler(Tfs_Closed);
                        }
                    }
                    catch (Exception ex)
                    {
                        VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "cbMenu_DropDownClosed", "ctlUserVideo.xaml.cs");
                    }
                }
                else if (cbMenu.SelectedItem != null && cbMenu.SelectedItem.ToString() == "Cancel")
                {
                    try
                    {
                        MessageBoxResult result = MessageBox.Show("Do You Really Want To Remove " + lblUName.Content.ToString() + "'s Video", "Remove Video", MessageBoxButton.YesNo);

                        if (result == MessageBoxResult.Yes)
                        {
                            if (EntRemoveUser != null)
                            {
                                EntRemoveUser(lblUName.Content.ToString());
                            }
                            netp2pDirectXVideoChannel.Close();
                        }
                        if (Tfs != null)
                        {
                            Tfs.Close();
                        }
                    }
                    catch (Exception ex)
                    {
                        VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "cbMenu_DropDownClosed", "ctlUserVideo.xaml.cs");
                    }
                }
                else if (cbMenu.SelectedItem != null && cbMenu.SelectedItem.ToString() == "Video Configuration")
                {
                    try
                    {
                        filters = new Filters();

                        if (filters.VideoInputDevices.Count > 1)
                        {
                            lstVideoInput = new List <string>();
                            lstVideoInput = filters.VideoInputDevices.GetVideoInputDevices();

                            objShowVideo = new ShowVideoInputs(lstVideoInput);
                            objShowVideo.EntSelectedDevice += new ShowVideoInputs.delSelectedDevice(objShowVideo_EntSelectedDevice);
                            objShowVideo.Show();
                        }
                        else
                        {
                            InitCapture("Low", 0);
                        }
                    }
                    catch (Exception ex)
                    {
                        if (string.Compare(ex.Message, "No devices of the category") == 0)
                        {
                            MessageBox.Show("Sorry You Dont Have Any Video Device Attached To Tour System", "VMukti Says: Video Conference");
                        }
                        else
                        {
                            VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "cbMenu_DropDownClosed", "ctlUserVideo.xaml.cs");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "cbMenu_DropDownClosed", "ctlUserVideo.xaml.cs");
            }
        }
Пример #4
0
        void cbMenu_DropDownClosed(object sender, EventArgs e)
        {
            try
            {
                if (cbMenu.SelectedItem != null && cbMenu.SelectedItem.ToString() == "Full Screen")
                {
                    try
                    {
                        if (FullScreenMe || FullScreenOther)
                        {
                            MessageBox.Show("Video is all ready running in Full Screen");
                        }
                        else
                        {
                            if (MyVidType == "Me")
                            {
                                FullScreenMe = true;
                            }
                            else
                            {
                                FullScreenOther = true;
                            }

                            FSUname = lblUName.Content.ToString();

                            Tfs = new TestFullScreen();
                            Tfs.Title = lblUName.Content.ToString() + " Video In Full Screen Mode";
                            Tfs.Show();

                            Tfs.Closed += new EventHandler(Tfs_Closed);
                        }
                    }
                    catch (Exception ex)
                    {
                        VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "cbMenu_DropDownClosed", "ctlUserVideo.xaml.cs");
                    }
                }
                else if (cbMenu.SelectedItem != null && cbMenu.SelectedItem.ToString() == "Cancel")
                {
                    try
                    {
                        MessageBoxResult result = MessageBox.Show("Do You Really Want To Remove " + lblUName.Content.ToString() + "'s Video", "Remove Video", MessageBoxButton.YesNo);

                        if (result == MessageBoxResult.Yes)
                        {
                            if (EntRemoveUser != null)
                            {
                                EntRemoveUser(lblUName.Content.ToString());
                            }
                            netp2pDirectXVideoChannel.Close();
                        }
                        if (Tfs != null)
                        {
                            Tfs.Close();
                        }
                    }
                    catch (Exception ex)
                    {
                        VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "cbMenu_DropDownClosed", "ctlUserVideo.xaml.cs");
                    }
                }
                else if (cbMenu.SelectedItem != null && cbMenu.SelectedItem.ToString() == "Video Configuration")
                {
                    try
                    {
                        filters = new Filters();

                        if (filters.VideoInputDevices.Count > 1)
                        {
                            lstVideoInput = new List<string>();
                            lstVideoInput = filters.VideoInputDevices.GetVideoInputDevices();

                            objShowVideo = new ShowVideoInputs(lstVideoInput);
                            objShowVideo.EntSelectedDevice += new ShowVideoInputs.delSelectedDevice(objShowVideo_EntSelectedDevice);
                            objShowVideo.Show();
                        }
                        else
                        {
                            InitCapture("Low", 0);
                        }
                    }
                    catch (Exception ex)
                    {
                        if (string.Compare(ex.Message, "No devices of the category") == 0)
                        {
                            MessageBox.Show("Sorry You Dont Have Any Video Device Attached To Tour System", "VMukti Says: Video Conference");
                        }
                        else
                        {
                            VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "cbMenu_DropDownClosed", "ctlUserVideo.xaml.cs");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "cbMenu_DropDownClosed", "ctlUserVideo.xaml.cs");
            }
        }