private void ModuleLaunchButton_Click(object sender, EventArgs e) { try { XDKUtilities.LaunchModule(Console, Connection, ModulePathEdit.Text); } catch (Exception ex) { XtraMessageBox.Show(string.Format("Failed to launch {0}.{1}{2}", ModuleControlGroup.Text, Environment.NewLine, XDKUtilities.CreateExceptionMessage(ex, Console.XboxManager)), "DevTool Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void GetValuesButton_Click(object sender, EventArgs e) { try { converting = true; if (string.IsNullOrWhiteSpace(GamertagEdit.Text)) { resUser = XDKUtilities.XUserFindUser(console, address, p1XUID, XtraFunctions.ValueFromHex(XUIDEdit.Text.Insert(0, "0x"))); GamertagEdit.Text = string.IsNullOrWhiteSpace(resUser.Gamertag) ? "(XUID does not exist on the service)" : resUser.Gamertag; ShowGamercardButton.Enabled = resUser.OnlineXUID != 0; ViewGamertagButton.Enabled = resUser.OnlineXUID != 0; } else { resUser = XDKUtilities.XUserFindUser(console, address, p1XUID, GamertagEdit.Text); if (resUser.OnlineXUID == 0) { XUIDEdit.Text = "(Gamertag does not exist on the service)"; } else { XUIDEdit.Text = XtraFunctions.ValueToHex(resUser.OnlineXUID).Remove(0, 2).PadLeft(16, '0'); GamertagEdit.Text = resUser.Gamertag; //To correct case. } ShowGamercardButton.Enabled = resUser.OnlineXUID != 0; ViewGamertagButton.Enabled = resUser.OnlineXUID != 0; } } catch (Exception ex) { XtraMessageBox.Show("Failed to carry out the conversion." + Environment.NewLine + XDKUtilities.CreateExceptionMessage(ex, console.XboxManager), "DevTool Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } converting = false; }
private void ShowGamercardButton_Click(object sender, EventArgs e) { retry: try { XDKUtilities.XamShowGamerCardUIForXUID(console, 0, resUser.OnlineXUID); } catch (Exception ex) { if (ex is COMException) { if (((COMException)ex).ErrorCode == 5) //XDRPC returns 5 if the guide is open. { if (XtraMessageBox.Show(string.Format("You currently have the Xbox Guide opened. Close it and then select OK.{0}If you do not have the guide opened, something else is wrong..", Environment.NewLine), "Guide Open", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK) { return; } goto retry; } } XtraMessageBox.Show(string.Format("Failed to show {0}'s Gamercard UI.{1}{2}", resUser.Gamertag, Environment.NewLine, XDKUtilities.CreateExceptionMessage(ex, console.XboxManager)), "DevTool Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void DrivePathEdit_ButtonClick(object sender, ButtonPressedEventArgs e) { try { Cursor = Cursors.WaitCursor; WindowsTaskbarHelper.SetProgressState(TaskbarButtonProgressMode.Indeterminate); mainForm.ShowWaitForm("Listing mounted packages..."); var sb = new StringBuilder(); sb.AppendLine("These packages are currently mounted and can be accessed. You do not have write access to PIRS/LIVE packages. Console signed volumes will continue to expand until their maximum size (4 GB) is reached."); sb.AppendLine(); foreach (var package in drives.GetMountedPackageDeviceNames()) { sb.AppendLine(package.Key); sb.AppendLine(package.Value); } Cursor = Cursors.Default; WindowsTaskbarHelper.SetProgressState(TaskbarButtonProgressMode.NoProgress); mainForm.CloseWaitForm(); using (var txtdf = new TextDisplayForm("Mounted Packages", sb)) txtdf.ShowDialog(); } catch (Exception ex) { Cursor = Cursors.Default; WindowsTaskbarHelper.SetProgressState(TaskbarButtonProgressMode.Error); mainForm.CloseWaitForm(); XtraMessageBox.Show("Failed to list the mounted package structures." + Environment.NewLine + XDKUtilities.CreateExceptionMessage(ex, manager), "DevTool Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } WindowsTaskbarHelper.SetProgressState(TaskbarButtonProgressMode.NoProgress); }