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