public void onConnectHandler(object sender, ConnectEventArgs args) { AppendTextBox("Device connected (Callback " + args.GetHashCode() + ")"); AppendTextBox(""); if (iDevice.Exists("/usr/libexec/afc2d")) { // Continue... bool AFC2_installed = iDevice.Exists("/usr/libexec/afc2d"); DialogResult dr = MessageBox.Show("A new device connected.\nName: " + iDevice.GetDeviceName + "\niOS: " + iDevice.GetDeviceVersion + "\nJailbroken: " + iDevice.IsJailbreak + "\nAFC2 installed: " + AFC2_installed + "\nDo you want to edit the hosts file?", "New device!", MessageBoxButtons.YesNo, MessageBoxIcon.Information); switch (dr) { case DialogResult.Yes: HostsForm hf = new HostsForm(); hf.gimmedatdevice(iDevice); hf.ShowDialog(); break; default: // ? break; } } else { MessageBox.Show("AFC2 is required to continue! \nYou can download it at Cydia. \nSearch \"Apple File Conduit 2\"", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
protected void OnDisconnect(ConnectEventArgs args) { ConnectEventHandler disconnect = this.Disconnect; if (disconnect != null) { disconnect(this, args); } }
protected void OnConnect(ConnectEventArgs args) { ConnectEventHandler connect = this.Connect; if (connect != null) { connect(this, args); } }
public void onDisconnectHandler(object sender, ConnectEventArgs args) { }