Пример #1
0
 private void updateContact(ControlCommandOccuredEventArgs e)
 {
     if (ContactUpdate != null)
     {
         ContactUpdate(this, e);
     }
 }
Пример #2
0
        private void OnContactUpdate(object sender, ControlCommandOccuredEventArgs e)
        {
            Contact cnt = ContactBuilder.getContactFromReceivedData(e.data);

            Console.WriteLine("contact update event");
            Console.WriteLine("id" + e.id + "\nmac: " + cnt.mac + "\nname: " + cnt.name + "\ncurrent ip: " + cnt.currentIp);

            if (contacts.ContainsKey(e.id))
            {
                contacts[e.id].updateContact(cnt);

//                MiddleController.getInstance().fileShareController.setupTempOutputFolder(settings.Default.contactPictures);
            }
            else
            {
                Console.WriteLine("Contact id not found for updating..  id: " + e.id);
                Console.Write("contacts now have are: ");

                foreach (var cn in contacts)
                {
                    Console.Write(cn.Key + ",");
                }
                Console.WriteLine();
            }

//            Console.WriteLine("current ip of update comming contact: "+contact.currentIp);
//            contacts[contact.currentIp].updateContact(contact);
        }
Пример #3
0
 private void fileComming(ControlCommandOccuredEventArgs e)
 {
     if (FileComming != null)
     {
         FileComming(this, e);
     }
 }
Пример #4
0
 private void connectedControl(ControlCommandOccuredEventArgs e)
 {
     if (Connected != null)
     {
         Connected(this, e);
     }
 }
Пример #5
0
 private void fileRejected(ControlCommandOccuredEventArgs e)
 {
     if (FileRejected != null)
     {
         FileRejected(this, e);
     }
 }
Пример #6
0
 private void fileConfiremed(ControlCommandOccuredEventArgs e)
 {
     if (FileConfirmed != null)
     {
         FileConfirmed(this, e);
     }
 }
Пример #7
0
 private void audioComming(ControlCommandOccuredEventArgs e)
 {
     if (AudioComming != null)
     {
         AudioComming(this, e);
     }
 }
Пример #8
0
        private void controlSelect(object sender, ControlCommandOccuredEventArgs e)
        {
            Control typeOfControl = e.control;

            switch (typeOfControl)
            {
            case Control.ConnectedCccccc:
                connectedControl(e);
                break;

            case Control.SendmemacCccccc:
                sendMacControl(e);
                break;

            case Control.SendingmacCcccc:
                macReceivedControl(e);
                break;

            case Control.FileCommingCccc:
                fileComming(e);
                break;

            case Control.FileConfiremedC:
                fileConfiremed(e);
                break;

            case Control.FileRejectedCcc:
                fileRejected(e);
                break;

            case Control.AudioCommingCcc:
                audioComming(e);
                break;

            case Control.ContactUpdateCc:
                updateContact(e);
                break;

            default:
                break;
            }
        }
Пример #9
0
 public void OnControlOccured(object sender, ControlCommandOccuredEventArgs e)
 {
     controlSelect(sender, e);
 }
Пример #10
0
 private void sendMacControl(ControlCommandOccuredEventArgs e)
 {
     EndPoint ip = e.socket.RemoteEndPoint;
     //send mac
 }
Пример #11
0
 private void macReceivedControl(ControlCommandOccuredEventArgs e)
 {
     EndPoint ip = e.socket.RemoteEndPoint;
     //mac recieved from ip
 }