Ejemplo n.º 1
0
 private void updateContact(ControlCommandOccuredEventArgs e)
 {
     if (ContactUpdate != null)
     {
         ContactUpdate(this, e);
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
 private void fileComming(ControlCommandOccuredEventArgs e)
 {
     if (FileComming != null)
     {
         FileComming(this, e);
     }
 }
Ejemplo n.º 4
0
 private void connectedControl(ControlCommandOccuredEventArgs e)
 {
     if (Connected != null)
     {
         Connected(this, e);
     }
 }
Ejemplo n.º 5
0
 private void fileRejected(ControlCommandOccuredEventArgs e)
 {
     if (FileRejected != null)
     {
         FileRejected(this, e);
     }
 }
Ejemplo n.º 6
0
 private void fileConfiremed(ControlCommandOccuredEventArgs e)
 {
     if (FileConfirmed != null)
     {
         FileConfirmed(this, e);
     }
 }
Ejemplo n.º 7
0
 private void audioComming(ControlCommandOccuredEventArgs e)
 {
     if (AudioComming != null)
     {
         AudioComming(this, e);
     }
 }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 9
0
 public void OnControlOccured(object sender, ControlCommandOccuredEventArgs e)
 {
     controlSelect(sender, e);
 }
Ejemplo n.º 10
0
 private void sendMacControl(ControlCommandOccuredEventArgs e)
 {
     EndPoint ip = e.socket.RemoteEndPoint;
     //send mac
 }
Ejemplo n.º 11
0
 private void macReceivedControl(ControlCommandOccuredEventArgs e)
 {
     EndPoint ip = e.socket.RemoteEndPoint;
     //mac recieved from ip
 }