Ejemplo n.º 1
0
 public void ItemChangeState(int local_index, bool State)
 {
     if (InvokeRequired)
     {
         ItemChangeStateCallBack Call = new ItemChangeStateCallBack(ItemChangeState);
         Invoke(Call, new object[] { local_index, State });
     }
     else
     {
         string Nick = ContactObjects.ContactStruct[local_index].Nick;
         ContactlistView.Items.RemoveAt(local_index);
         taskbarNotifier.Show(Nick, string.Format("{0} now is {1}", Nick, ContactObjects.GetConnected(local_index)), 2000, 2000, 2000);
         if (State)
         {
             ContactObjects.ContactStruct[local_index].item           = ContactlistView.Items.Insert(local_index, ContactObjects.ContactStruct[local_index].Nick, 0);
             ContactObjects.ContactStruct[local_index].item.Group     = ContactObjects.GroupsStruct.OnlineGroup;
             ContactObjects.ContactStruct[local_index].item.ForeColor = Color.Green;
         }
         else
         {
             ContactObjects.ContactStruct[local_index].item           = ContactlistView.Items.Insert(local_index, ContactObjects.ContactStruct[local_index].Nick, 1);
             ContactObjects.ContactStruct[local_index].item.Group     = ContactObjects.GroupsStruct.OfflineGroup;
             ContactObjects.ContactStruct[local_index].item.ForeColor = Color.Red;
         }
         MSG.ChangeState(local_index, State);
     }
 }
Ejemplo n.º 2
0
 public void ChangeContactState(int id, bool state)
 {
     if (ContactList_State)
     {
         int index = ContactObjects.GetIndexById(id);
         ContactObjects.ContactStruct[index].IsConneced = state;
         ItemChangeState(index, state);
     }
 }
Ejemplo n.º 3
0
        public void WriteAway(int ID, string message)
        {
            int index = ContactObjects.GetIndexById(ID);

            if (ContactObjects.IsOpendMessage(index))
            {
                AddTime(index);
                string Nick = ContactObjects.ContactStruct[index].Nick;

                WriteRTB(ContactObjects.ContactStruct[index].MessageDialog.ServerText, String.Format("{0} personal message is : \n{1}", Nick, message), Color.Red, ServerText.Font);
            }
        }
Ejemplo n.º 4
0
 private void ContactlistView_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         try
         {
             ListItemSelected = ContactlistView.HitTest(e.X, e.Y);
         }
         catch
         {
             return;
         }
         SelectNick = ListItemSelected.Item.Text;
         MSG.OpenDialog(ContactObjects.GetIndexByNick(SelectNick));
     }
 }
Ejemplo n.º 5
0
        public void ChangeTypingState(int TyperId, bool State)
        {
            int TyperIndex = ContactObjects.GetIndexById(TyperId);

            if (ContactObjects.ContactStruct[TyperIndex].IsMessagsOpend)
            {
                if (ContactObjects.ContactStruct[TyperIndex].MessageDialog.StatusBox.InvokeRequired)
                {
                    ChangeTypingStateCallBack thisthread = new ChangeTypingStateCallBack(ChangeTypingState);
                    ContactObjects.ContactStruct[TyperIndex].MessageDialog.Invoke(thisthread, new object[] { TyperId, State });
                }
                else
                {
                    ContactObjects.ContactStruct[TyperIndex].MessageDialog.StatusBox.Visible = State;
                    ContactObjects.ContactStruct[TyperIndex].MessageDialog.StatusBox.Text    = string.Format("{0} is typeing ...", ContactObjects.ContactStruct[TyperIndex].Nick);
                }
            }
        }
Ejemplo n.º 6
0
        public void WriteMessage(int senderid, string message)
        {
            int index = ContactObjects.GetIndexById(senderid);

            if (ContactObjects.IsOpendMessage(index))
            {
                ContactObjects.ContactStruct[index].MessageDialog.Activate();
                AddTime(index);
                string format = ContactObjects.ContactStruct[index].Nick + " Says: " + message;
                WriteRTB(ContactObjects.ContactStruct[index].MessageDialog.ServerText, message, Color.Red, ServerText.Font);
            }
            else
            {
                OpenDialog(index);
                Thread.Sleep(100);
                WriteMessage(senderid, message);
            }
        }
Ejemplo n.º 7
0
 private void messages_Load(object sender, EventArgs e)
 {
     this.Text               = string.Format("{0} ({1}) - LiveChat Message Session", ContactObjects.ContactStruct[this.index].Nick, ContactObjects.GetConnected(this.index));
     this.ServerText.Text    = string.Format("LiveChat {0} ({1}) ...", ContactObjects.ContactStruct[this.index].Nick, ContactObjects.GetConnected(this.index));
     this.MePictureBox.Image = Protocol.OBJ.MyImage;
     Protocol.SendRequestAway(ContactObjects.ContactStruct[this.index].id);
     // TO DO : HERE I NEED REUST THE profile IMAGE OF MAN THAT I SPEAK WITH IM
 }
Ejemplo n.º 8
0
 public void ChangeState(int index, bool state)
 {
     if (ContactObjects.ContactStruct[index].IsMessagsOpend)
     {
         ContactObjects.ContactStruct[index].MessageDialog.Text = string.Format("{0} ({1}) - LiveChat Message Session", ContactObjects.ContactStruct[index].Nick, ContactObjects.GetConnected(index));
         AddTime(index);
         ContactObjects.ContactStruct[index].MessageDialog.ServerText.Text += String.Format("{0} Now is {1}", ContactObjects.ContactStruct[index].Nick, ContactObjects.GetConnected(index));
     }
 }
Ejemplo n.º 9
0
        private void messageToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int index = ContactObjects.GetIndexByNick(SelectNick);

            MSG.OpenDialog(index);
        }