Ejemplo n.º 1
0
 private void ����Ի�ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (lstVisitors.SelectedItems.Count>0)
     {
         if (IsIP == lstVisitors.SelectedItems[0].SubItems[2].Text)
         {
             DialogResult choice = MessageBox.Show("��������û���������", "�Ƿ��ط�?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
             if (choice == DialogResult.OK)
             {
                 RequestInfo info = this.lstVisitors.SelectedItems[0].Tag as RequestInfo;
                 ChatRequestInfo requestinfo = new ChatRequestInfo();
                 requestinfo.ChatId = Guid.NewGuid().ToString();//chatid
                 requestinfo.AccountId = info.AccoutId.ToString();
                 requestinfo.VisitorIP = lstVisitors.SelectedItems[0].SubItems[2].Text;//IP
                 requestinfo.AcceptByOpereratorId = Program.CurrentOperator.Id; //������Ա
                 requestinfo.RequestDate = DateTime.Now;
                 requestinfo.VisitorName = "";
                 requestinfo.VisitorEmail = "";
                 requestinfo.VisitorUserAgent = lstVisitors.SelectedItems[0].SubItems[4].Text;//�����
                 requestinfo.WasAccept = false;
                 //��Ϣ��ʾ
                 TabPage tab = new TabPage(requestinfo.VisitorIP);
                 LiveChat lc = new LiveChat();
                 lc.Tag = tabChats;
                 lc.ChatRequest = requestinfo;
                 lc.Dock = DockStyle.Fill;
                 tab.Controls.Add(lc);
                 tabChats.TabPages.Add(tab);
                 tab.Focus();
                 TabInfo tabInfo = new TabInfo();
                 tabInfo.ChatId = requestinfo.ChatId;
                 tabInfo.Dock = DockStyle.Fill;
                 if (currentVisitors.ContainsKey(requestinfo.VisitorIP))
                 {
                     tabInfo.RequestEntity = currentVisitors[requestinfo.VisitorIP] as RequestInfo;
                 }
                 //�޸�������Ϣ
                 chatInfo.Add(tabInfo);
                 RefreshTabInfo();
                 IsIP = lstVisitors.SelectedItems[0].SubItems[2].Text;
                 ws.TransferChat(requestinfo);
                 //�޸Ŀͷ����
                 ws.AcceptChatRequest(requestinfo.ChatId, Program.CurrentOperator.Id);//������Ա
             }
         }
         else
         {
             DialogResult choice = MessageBox.Show("�Ƿ�ȷ�Ϸ�������", "YesNo?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
             if (choice == DialogResult.Yes)
             {
                 RequestInfo info = this.lstVisitors.SelectedItems[0].Tag as RequestInfo;
                 ChatRequestInfo requestinfo = new ChatRequestInfo();
                 requestinfo.ChatId = Guid.NewGuid().ToString();//chatid
                 requestinfo.AccountId = info.AccoutId.ToString();
                 requestinfo.VisitorIP = lstVisitors.SelectedItems[0].SubItems[2].Text;//IP
                 requestinfo.AcceptByOpereratorId = Program.CurrentOperator.Id; //������Ա
                 requestinfo.RequestDate = DateTime.Now;
                 requestinfo.VisitorName = "";
                 requestinfo.VisitorEmail = "";
                 requestinfo.VisitorUserAgent = lstVisitors.SelectedItems[0].SubItems[4].Text;//�����
                 requestinfo.WasAccept = false;
                 ws.TransferChat(requestinfo);
                 IsIP = lstVisitors.SelectedItems[0].SubItems[2].Text;
                 //��Ϣ��ʾ
                 TabPage tab = new TabPage(requestinfo.VisitorIP);
                 LiveChat lc = new LiveChat();
                 lc.Tag = tabChats;
                 lc.ChatRequest = requestinfo;
                 lc.Dock = DockStyle.Fill;
                 tab.Controls.Add(lc);
                 tabChats.TabPages.Add(tab);
                 tab.Focus();
                 TabInfo tabInfo = new TabInfo();
                 tabInfo.ChatId = requestinfo.ChatId;
                 tabInfo.Dock = DockStyle.Fill;
                 if (currentVisitors.ContainsKey(requestinfo.VisitorIP))
                 {
                     tabInfo.RequestEntity = currentVisitors[requestinfo.VisitorIP] as RequestInfo;
                 }
                 //�޸�������Ϣ
                 chatInfo.Add(tabInfo);
                 RefreshTabInfo();
             }
         }
     }
     else
     {
         MessageBox.Show("�㻹û��ѡ���˭���жԻ�","��ѡ��",MessageBoxButtons.OK,MessageBoxIcon.Stop);
     }
 }
Ejemplo n.º 2
0
        //��������
        private void btnAccept_Click(object sender, EventArgs e)
        {
            if (drpChatRequest.SelectedItem != null)
            {
                //����
                player.Stop();
                //������Ϣ
                ChatRequestInfo req = (ChatRequestInfo)drpChatRequest.SelectedItem;
                drpChatRequest.Items.Remove(req);
                drpChatRequest.Text = string.Empty;

                TabPage tab = new TabPage(req.VisitorIP);
                LiveChat lc = new LiveChat();
                lc.Tag = tabChats;
                lc.ChatRequest = req;
                lc.Dock = DockStyle.Fill;
                tab.Controls.Add(lc);
                tabChats.TabPages.Add(tab);
                tab.Focus();

                TabInfo tabInfo = new TabInfo();
                tabInfo.ChatId = req.ChatId;
                tabInfo.Dock = DockStyle.Fill;
                if (currentVisitors.ContainsKey(req.VisitorIP))
                {
                    tabInfo.RequestEntity = currentVisitors[req.VisitorIP] as RequestInfo;
                }
                //���������Ϣ
                chatInfo.Add(tabInfo);
                RefreshTabInfo();
                //�޸Ŀͷ����
                ws.AcceptChatRequest(req.ChatId,Program.CurrentOperator.Id);//������Ա
            }
        }
Ejemplo n.º 3
0
		private void btnInvite_Click(object sender, EventArgs e)
		{
			if (lstVisitors.SelectedIndices.Count > 0)
			{
				List<string> ips = new List<string>();
				foreach(int item in lstVisitors.SelectedIndices)
					ips.Add(lstVisitors.Items[item].SubItems[2].Text);

				if (MessageBox.Show("Are you sure you want to invite " + ips.Count + " visitor(s)?", "LCSK", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
				{
					foreach (string ip in ips)
					{
						ChatRequest req = ws.Invite(new Guid(Program.CurrentOperator.Password), Program.CurrentOperator.OperatorId, ip, "");
						
						// Add a new tab page that will contain the chat session
						TabPage tab = new TabPage(req.VisitorIp);
						LiveChat lc = new LiveChat();
						lc.ChatRequest = req;
						lc.Dock = DockStyle.Fill;
						tab.Controls.Add(lc);
						tabChats.TabPages.Add(tab);
						tab.Focus();

						// Add a new TabInfo control
						TabInfo tabInfo = new TabInfo();
						tabInfo.ChatId = req.ChatId;
						tabInfo.ChatRequest = req;
						tabInfo.MyTab = tab;
						tabInfo.Dock = DockStyle.Fill;

						// Get the request
						if (currentVisitors.ContainsKey(req.VisitorIp))
						{
							tabInfo.RequestEntity = currentVisitors[req.VisitorIp] as WebRequest;
						}

						chatInfo.Add(tabInfo);
						RefreshTabInfo();
					}

					
				}
			}
		}
Ejemplo n.º 4
0
        private void btnAccept_Click(object sender, EventArgs e)
        {
            // Accept a new chat request
            if (drpChatRequest.SelectedItem != null)
            {
                player.Stop();


                ChatRequest req = (ChatRequest)drpChatRequest.SelectedItem;

                // Remove the chat request from the combo
                drpChatRequest.Items.Remove(req);
                drpChatRequest.Text = string.Empty;

				// Accept the chat request
				ws.AcceptRequest(new Guid(Program.CurrentOperator.Password), req.ChatId, Program.CurrentOperator.OperatorId);

                // Add a new tab page that will contain the chat session
                TabPage tab = new TabPage(req.VisitorIp);
                LiveChat lc = new LiveChat();
                lc.ChatRequest = req;
                lc.Dock = DockStyle.Fill;
                tab.Controls.Add(lc);
                tabChats.TabPages.Add(tab);
                tab.Focus();

                // Add a new TabInfo control
                TabInfo tabInfo = new TabInfo();
                tabInfo.ChatId = req.ChatId;
				tabInfo.ChatRequest = req;
				tabInfo.MyTab = tab;
                tabInfo.Dock = DockStyle.Fill;



                // Get the request
                if (currentVisitors.ContainsKey(req.VisitorIp))
                {
                    tabInfo.RequestEntity = currentVisitors[req.VisitorIp] as WebRequest;
                }


                chatInfo.Add(tabInfo);
                RefreshTabInfo();
            }
        }
Ejemplo n.º 5
0
 private void _addTab(UserControl ctrl, string title)
 {
     TabPage page = new TabPage(title);
     page.Controls.Add(ctrl);
     tabMainTabControl.TabPages.Add(page);
     page.Focus();
 }
Ejemplo n.º 6
0
 void _activityControlsController_OnExpandCompositeActivity(BaseActivity activity){
     var tabPage = new TabPage(activity.Name);
     tabControl.TabPages.Add(tabPage);
     tabPage.Focus();
 }
Ejemplo n.º 7
0
        /*
        protected void Preprocess (string sSearchString)
        {
            int i_Stress = Convert.ToInt32(true); // It should've been bool
            if (Regex.IsMatch (sSearchString, (string)">"))
            {
                i_Stress = Convert.ToInt32(true);
            }
            else
            {
                i_Stress = Convert.ToInt32(true); // Test
            }
            sSearchString = sSearchString.Replace(">", "");
            if (Regex.IsMatch (sSearchString, (string)"\\-"))
            {
                string[] arr_Range = Regex.Split (sSearchString, (string)"([0-9]*)\\-([0-9]*)");
                long l_start_id = long.Parse(arr_Range[1]);
                long l_end_id = long.Parse(arr_Range[2]);
                m_LexPreprocessor.PrepareLexemes (l_start_id, l_end_id, i_Stress);
            }
            else
            {
                long l_lexeme_id = long.Parse (sSearchString);
                m_LexPreprocessor.PrepareLexeme(l_lexeme_id, i_Stress);
            }

        }   //  Preprocess (...)
        */
        protected void ShowParseOutput()
        {
            int iWordform = 0, iPreviousID = -1;
            tabControl.TabPages.Clear();

            if (null == m_Parser)
            {
                MessageBox.Show("Internal error: Parser object is null.", "Zal error", MessageBoxButtons.OK);
                return;
            }

            int iWordForm = 0;
            CWordFormManaged wordform = null;
            EM_ReturnCode eRet = (EM_ReturnCode)m_Parser.eGetFirstWordForm(ref wordform);
            if (CErrorCode.bError(eRet))
            {
                MessageBox.Show("Error");
                return;
            }
            if(EM_ReturnCode.H_NO_ERROR != eRet)
            {
                MessageBox.Show("Form not found");
                return;
            }

            do
            {
                m_listWordForms.Add(wordform);
                AnalysisPanel ap = new AnalysisPanel(iWordform);
            //                ap.Location = new System.Drawing.Point(0, iWordform * ap.Size.Height + 4);
                string sWordForm = wordform.sWordForm();
                MarkStress(ref sWordForm, wordform);
                ap.sWordform = sWordForm;
                ap.sID = wordform.llLexemeId().ToString();
                ap.eoPOS = wordform.ePos();
                ap.eoAspect = wordform.eAspect();
                ap.eoGender = wordform.eGender();
                ap.eoCase = wordform.eCase();
                ap.eoNumber = wordform.eNumber();
                ap.eoAnimacy = wordform.eAnimacy();
                ap.eoPerson = wordform.ePerson();
                ap.eoReflexiveness = wordform.eReflexive();
                ap.eoSubparadigm = wordform.eSubparadigm();
                iWordform = 0;
                iPreviousID = (int)wordform.llLexemeId();
                TabPage tab_Lexeme = new TabPage(wordform.sWordForm());
            //                tab_Lexeme.Text = wordform.sWordForm();
                tab_Lexeme.AutoScroll = true;
                tab_Lexeme.Controls.Add(ap);
                tabControl.TabPages.Add(tab_Lexeme);
                tab_Lexeme.Show();
                tab_Lexeme.Focus();
                ++iWordform;
                ap.Show();

                eRet = (EM_ReturnCode)m_Parser.eGetNextWordForm(ref wordform);

            } while (EM_ReturnCode.H_NO_ERROR == eRet);
        }