Exemplo n.º 1
0
        public ctlDialer(VMuktiAPI.PeerType objLocalPeerType, string uri, ModulePermissions[] MyPermissions,string Role)
        {
            InitializeComponent();
             System.OperatingSystem osInfo = System.Environment.OSVersion;
             if (osInfo.Version.Major.ToString() == "6")
             {
                 blIsVista = true;
                 ProcStartAudioVistaExe = new System.Diagnostics.Process();
                 ProcStartAudioVistaExe.StartInfo.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory.ToString() + @"\VistaAudio";
                 ProcStartAudioVistaExe.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                 ProcStartAudioVistaExe.StartInfo.FileName = AppDomain.CurrentDomain.BaseDirectory.ToString() + @"\VistaAudio\VMuktiAudio.VistaService.exe";
                 ProcStartAudioVistaExe.Start();
             }
             else
             {
                 blIsVista = false;
             }
            objPeerType = objLocalPeerType;
            _MyPermissions = MyPermissions;
            FncPermissionsReview();
            try
            {
                btnPad.Click += new RoutedEventHandler(btnPad_Click);
                btnReject.Click += new RoutedEventHandler(btnReject_Click);
                btnAccept.Click += new RoutedEventHandler(btnAccept_Click);
                btnCancel.Click += new RoutedEventHandler(btnCancel_Click);
                btnTransfer.Click += new RoutedEventHandler(btnTransfer_Click);
                btnDTMF.Click += new RoutedEventHandler(btnDTMF_Click);
                btnCall.Click += new RoutedEventHandler(btnCall_Click);
                btnHangup.Click += new RoutedEventHandler(btnHangup_Click);
                btnHold.Click += new RoutedEventHandler(btnHold_Click);
                btnConference.Click += new RoutedEventHandler(btnConference_Click);
                btnChannels = new Button[6];

                int btnLeft = 10;
                int btnTop = 60;
                for (int i = 0; i < 6; i++)
                {
                    (btnChannels[i]) = new Button();
                    btnChannels[i].Height = 20;
                    btnChannels[i].Width = 34;
                    btnChannels[i].Content = (i + 1).ToString();
                    btnChannels[i].Name = "btnCh" + (i + 1).ToString();
                    btnChannels[i].FontSize = 11;
                    btnChannels[i].BorderThickness = new Thickness(0, 0, 0, 0);
                    btnChannels[i].Margin = new Thickness(btnLeft, btnTop, 0, 0);
                    btnLeft = btnLeft + 39;
                    btnChannels[i].Click += new RoutedEventHandler(ChClick);
                    btnChannels[i].Tag = "Free";
                    btnChannels[i].IsEnabled = false;
                    CnvPhoneProperty.Children.Add(btnChannels[i]);
                    TimeCounterCollection.Add(i, "0:00:00");
                }
                VMuktiHelper.RegisterEvent("RegisterAgent").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(FncRegister);
                VMuktiHelper.RegisterEvent("Dial").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEventDial);
                VMuktiHelper.RegisterEvent("HangUp").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEventHangUp);
                VMuktiHelper.RegisterEvent("StartManualDialing").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEventStartManualDialing);
                VMuktiHelper.RegisterEvent("SetSoftPhoneEnable").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEvent_SetSoftPhoneEnable);
                VMuktiHelper.RegisterEvent("CallHangUPFromRender").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEvent);
                VMuktiAPI.VMuktiHelper.RegisterEvent("SignOut").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(ctlDialer_VMuktiEventSignOut);
                t1 = new System.Timers.Timer(1000);
                t1.Elapsed += new System.Timers.ElapsedEventHandler(t1_Elapsed);
                btnHold.IsEnabled = false;
                btnTransfer.IsEnabled = false;
                objDelDisplayName = new DelDisplayName(DisplayName);
                objHangupAdmin = new DelHangupAdmin(HangupAdmin);
                objBargeRequest = new DelBargeReqest(BargeRequest);

                Application.Current.Exit += new ExitEventHandler(Current_Exit);
                //FncRegister(null, null);

                if (blIsVista)
                {
                    System.Threading.Thread.Sleep(30000);
                    npcRTCVistaClient = new VMuktiService.NetPeerClient();
                    objNetP2PRTCVista = new clsNetTcpRTCVistaService();
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcJoin += new clsNetTcpRTCVistaService.DelsvcJoin(ctlDialer_entsvcJoin);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcCreateRTCClient += new clsNetTcpRTCVistaService.DelsvcCreateRTCClient(ctlDialer_entsvcCreateRTCClient);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcRegisterSIPPhone += new clsNetTcpRTCVistaService.DelsvcRegisterSIPPhone(ctlDialer_entsvcRegisterSIPPhone);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcAnswer += new clsNetTcpRTCVistaService.DelsvcAnswer(ctlDialer_entsvcAnswer);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcDial += new clsNetTcpRTCVistaService.DelsvcDial(ctlDialer_entsvcDial);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcHangup += new clsNetTcpRTCVistaService.DelsvcHangup(ctlDialer_entsvcHangup);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcHold += new clsNetTcpRTCVistaService.DelsvcHold(ctlDialer_entsvcHold);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcTransfer += new clsNetTcpRTCVistaService.DelsvcTransfer(ctlDialer_entsvcTransfer);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcRTCEvent += new clsNetTcpRTCVistaService.DelsvcRTCEvent(ctlDialer_entsvcRTCEvent);
                    ((clsNetTcpRTCVistaService)objNetP2PRTCVista).entsvcUnJoin += new clsNetTcpRTCVistaService.DelsvcUnJoin(ctlDialer_entsvcUnJoin);
                    ClientNetP2PRTCVistaChannel = (INetTcpRTCVistaServiceChannel)npcRTCVistaClient.OpenClient<INetTcpRTCVistaServiceChannel>("net.tcp://localhost:6060/NetP2PRTCVista", "NetP2PRTCVistaMesh", ref objNetP2PRTCVista);
                    ClientNetP2PRTCVistaChannel.svcJoin();
                }


                ThOpenClinet = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(FncOpenClinet));
                System.Collections.Generic.List<object> lstParameters = new System.Collections.Generic.List<object>();
                lstParameters.Add(objLocalPeerType);
                lstParameters.Add(uri);
                ThOpenClinet.Start(lstParameters);

                thostActiveAgent = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(hostActiveAgentService));
                List<object> lstParams = new List<object>();
                lstParams.Add("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapActiveAgentReport");
                lstParams.Add("P2PActiveAgentMesh");
                thostActiveAgent.Start(lstParams);
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "ctlDialer()", "ctlDialer.xaml.cs");
            }
        }
Exemplo n.º 2
0
        void GlobalVariable()
        {
            try
            {
                arr = new byte[16000];
                lstName = new List<string>();
                disposed = false;

                objDelSetSlide = new DelSetSlide(delSetSlide);
                objDelSetSlideList = new DelSetSlideList(delSetSlideList);
                objDelGetMsg = new DelGetMessage(delGetMessage);
                objDelDisplayName = new DelDisplayName(DisplayName);
                objDelSignOutMsg = new DelSignOutMessage(delSignoutMessage);
                objDelAsyncGetMessage = new DelAsyncGetMessage(delAsyncGetMessage);
            }
            catch(System.Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "GlobalVariable()", "UserControl1.xaml.cs");
            }
        }
Exemplo n.º 3
0
        void GlobalVariable()
        {
            try
            {
                objNetTcpChat = new clsNetTcpChat();
                objHttpChat = new clsHttpChat();
                temp = 0;
                tempcounter = 0;
                blnTypingStatus = false;
                blnSendTypeMsg = true;
                //arr = new byte[5000];
                lstName = new List<string>();
                lstTypingUsers = new List<string>();
                isChatHistoryFolderCreated = false;
                isChatHistoryEnabled = true;


                objDelDisplayName = new DelDisplayName(DisplayName);

                objDelSendMsg = new DelSendMessage(delSendMessage);
                objDelSignOutMsg = new DelSignOutMessage(delSignoutMessage);

                objDelSendPeerMsg = new DelSendPeerMessage(delSendPeerMessage);
                objDelGetUserList = new DelGetUserList(delGetUserList);
                objDelUserTypeing = new DelShowUserTypeing(delShowUserTypeMessage);
                objDelTextDownEvent = new DelTextDownEvent(delTextDownEvent);
                objDelAsyncGetMessage = new DelAsyncGetMessage(delAsyncGetMessage);
            
            }
            catch (Exception ex)
            {
                MessageBox.Show("GlobalVariable" +  ex.Message);
            }
        }
Exemplo n.º 4
0
        public FileSearch(VMuktiAPI.PeerType bindingtype, string uri, ModulePermissions[] MyPermissions, string Role)
        {
            try
            {
                InitializeComponent();

                objDelUIStatus = new DelUIStatus(FncDelUIStatus);
                objDelUIFileSearchEntsvcSearchResult = new DelUIFileSearchEntsvcSearchResult(FncDelUIFileSearchEntsvcSearchResult);
                objDelDisplayName = new DelDisplayName(DisplayName);
                DelThread dt = new DelThread(FncMain);
                this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, dt);
                this.listViewResults.MouseDoubleClick += new MouseButtonEventHandler(listViewResults_MouseDoubleClick);

                ThrHostFileSearch = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(FncHostFileSearchService));
                List<object> lstParams = new List<object>();
                lstParams.Add(bindingtype);
                lstParams.Add(uri);
                lstParams.Add(MyPermissions);
                ThrHostFileSearch.Start(lstParams);
             
                Rolee = Role;
                //lstBuddyList.Add("ADIANCE-222");
                //lstBuddyList.Add("ADIANCE07");
                //cnvMain.AllowDrop = true;
                //cnvMain.PreviewDrop += new DragEventHandler(cnvMain_PreviewDrop);

                Application.Current.Exit += new ExitEventHandler(Current_Exit);
                VMuktiAPI.VMuktiHelper.RegisterEvent("SignOut").VMuktiEvent += new VMuktiAPI.VMuktiEvents.VMuktiEventHandler(FileSearch_VMuktiEvent);

                ClsException.WriteToLogFile("Loading FileSearch Module");

                objDelAsyncGetMessage = new DelAsyncGetMessage(delAsyncGetMessage);
                objDelAsyncGetMessage4GetFileList = new DelAsyncGetMessage4GetFileList(delAsyncGetMessage4GetFileList);

                this.Loaded += new RoutedEventHandler(FileSearch_Loaded);

            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "FileSearch", "FileSearch.xaml.cs");
            }
        }
Exemplo n.º 5
0
        public ctlChat(VMuktiAPI.PeerType PeerType, string uri, ModulePermissions[] MyPermissions, string Role)
        {
            try
            {
                InitializeComponent();

                staGlobal = new System.Threading.Thread(new System.Threading.ThreadStart(GlobalVariable));
                staGlobal.Start();

                VMuktiAPI.ClsException.WriteToLogFile("chat:- " + uri); 

                bgHostService = new BackgroundWorker();

                this.Unloaded += new RoutedEventHandler(ctlChat_Unloaded);
                txtChat.KeyDown += new KeyEventHandler(txtChat_KeyDown);
                txtChat.TextChanged += new TextChangedEventHandler(txtChat_TextChanged);
                txtChat.AcceptsReturn = true;
                objDelDisplayName = new DelDisplayName(DisplayName);

                VMuktiAPI.VMuktiHelper.RegisterEvent("SignOut").VMuktiEvent += new VMuktiAPI.VMuktiEvents.VMuktiEventHandler(ctlChat_VMuktiEvent);

                Application.Current.Exit += new ExitEventHandler(Current_Exit);

                //modPer = MyPermissions;

                //objDelSendMsg = new DelSendMessage(delSendMessage);
                //objDelSignOutMsg = new DelSignOutMessage(delSignoutMessage);

                //objDelSendPeerMsg = new DelSendPeerMessage(delSendPeerMessage);
                //objDelGetUserList = new DelGetUserList(delGetUserList);
                //objDelUserTypeing = new DelShowUserTypeing(delShowUserTypeMessage);
                //objDelTextDownEvent = new DelTextDownEvent(delTextDownEvent);
                //objDelAsyncGetMessage = new DelAsyncGetMessage(delAsyncGetMessage);
               
                tTypingStatus.Interval = 3000;
                tTypingStatus.Elapsed += new System.Timers.ElapsedEventHandler(tTypingStatus_Elapsed);
               

                strRole = Role;
                strUri = uri;

                bgHostService.DoWork += new DoWorkEventHandler(bgHostService_DoWork);

                // tHostChat = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(hostchatservice));
                List<object> lstParams = new List<object>();
                lstParams.Add(PeerType);
                lstParams.Add(uri);
                lstParams.Add(MyPermissions);

                bgHostService.RunWorkerAsync(lstParams);

                //tHostChat.Start(lstParams);

                #region Chat History

                chkChatHistory.Unchecked += new RoutedEventHandler(chkChatHistory_Unchecked);
                chkChatHistory.Checked += new RoutedEventHandler(chkChatHistory_Checked);
                btnViewHistory.Click += new RoutedEventHandler(btnViewHistory_Click);

                chatHistoryPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                Directory.CreateDirectory(chatHistoryPath + "\\VMukti\\Chat History\\Logs for " + VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                chatHistoryPath += "\\VMukti\\Chat History\\Logs for " + VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName;

                #endregion


                #region resize

                this.Loaded += new RoutedEventHandler(ctlChat_Loaded);
              this.SizeChanged+=new SizeChangedEventHandler(this_SizeChanged);
                #endregion
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "ctlChat()", "ctlChat.xaml.cs");
            }
        }