public ADBState SetState(ADBState state) { State = state; return(state); }
public AdbExeException(ADBState state, string message) { mState = state; mMessage = message; }
public VerifyActivityFailedEventArgs(ADBState state) { mADBState = state; }
public AdbExeException(ADBState state) : this(state, null) { }
private bool HandleFailedVerification(ADBState state, bool offerRetry) { switch (state) { case ADBState.CannotRun: MessageBox.Show(this, Resources.MsgCannotRun, Resources.CptConnectionError, MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); case ADBState.Error: MessageBox.Show(this, Resources.MsgAdbError, Resources.CptConnectionError, MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); case ADBState.MoreDevices: MessageBox.Show(this, Resources.MsgMoreDevices, Resources.CptConnectionError, MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); case ADBState.InvalidState: MessageBox.Show(this, Resources.MsgInvalidState, Resources.CptConnectionError, MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); case ADBState.NoRoot: MessageBox.Show(this, Resources.MsgNoRoot, Resources.CptConnectionError, MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); case ADBState.NoDevices: string driverPath = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") == "AMD64" || Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432") == "AMD64" ? cDriverPath64Bit : cDriverPath32Bit; if (File.Exists(driverPath)) { if (MessageBox.Show(this, string.Format("{0}\n\n{1}", Resources.MsgNoDevices, Resources.MsgInstallDriverQuestion), Resources.CptConnectionError, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { mActivityExecutor.ActivityProvider.Stop(); mActivityExecutor.ActivityProvider.KillServer(); } catch { } try { Process.Start(driverPath).WaitForExit(); } catch { } mActivityExecutor.ActivityProvider.Start(); if (offerRetry) { return(MessageBox.Show(this, Resources.MsgDriverInstallationFinished, Resources.CptDriverInstallationFinished, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes); } } } else { MessageBox.Show(this, Resources.MsgNoDevices, Resources.CptConnectionError, MessageBoxButtons.OK, MessageBoxIcon.Warning); } return(false); } return(false); }