private void Iph_Connect(object sender, ConnectEventArgs args) { if (iph.IsConnected) { label4.Text = "Connected to [" + iph.DeviceProductType + "] " + iph.DeviceName + " iOS " + iph.ProductVersion; setStatus("Fetching Device Information..."); Dictionary<string, dynamic> battInfo = iph.RequestBatteryInfo(); setStatus("Processing Information..."); /* foreach (KeyValuePair<string, dynamic> kvp in battInfo) { MessageBox.Show(kvp.Key+" : "+kvp.Value.ToString()); } */ int cyclecount = (int)battInfo["CycleCount"]; int designcapacity = (int)battInfo["DesignCapacity"]; int currentcapacity = (int)battInfo["FullChargeCapacity"]; bool gasgauge = battInfo["GasGaugeCapability"] == true; bool fullycharged = battInfo["FullyCharged"] == true; bool charging = battInfo["BatteryIsCharging"] == true; int currentCharge = (int)battInfo["BatteryCurrentCapacity"]; label6.Text += cyclecount.ToString(); label7.Text += designcapacity.ToString(); label8.Text += currentcapacity.ToString(); label9.Text += gasgauge.ToString(); label10.Text += fullycharged.ToString(); label11.Text += currentCharge.ToString(); label12.Text += charging.ToString(); setStatus("Idle."); } }
private static void Mdv_Connect(object sender, MK.MobileDevice.ConnectEventArgs args) { Console.WriteLine("libimobiledevice.dll Connected [MUX] to " + mdv.DeviceName); Console.WriteLine("IsWifiConnect: {0}", mdv.IsWifiConnect); }
protected void OnDisconnect(ConnectEventArgs args) { ConnectEventHandler disconnect = this.Disconnect; if (disconnect != null) { disconnect(this, args); } }
private void Iph_Disconnect(object sender, ConnectEventArgs args) { ResetData(); }
protected void OnConnect(ConnectEventArgs args) { ConnectEventHandler connect = this.Connect; if (connect != null) { connect(this, args); } }