Ejemplo n.º 1
0
 public SigninForm(MainForm MainForm, IEnumerable <ConsoleProfile> LocalProfiles, ConsoleProfilesManager Manager)
 {
     InitializeComponent();
     mainForm               = MainForm;
     profileManager         = Manager;
     SigninTileControl.Text = "Profiles on " + profileManager.Console.Name;
     SigninTileControl.BeginUpdate();
     foreach (var profile in LocalProfiles)
     {
         var xai = XDKUtilities.XamProfileFindAccount((XboxConsole)profile.Console, profile.OfflineXuid.value);
         if (!profile.IsLiveProfile)
         {
             continue;
         }
         var ti = new TileItem {
             Tag = new TileTag {
                 Profile = profile, AccountInfo = xai
             }, Name = profile.Gamertag + "Tile", BackgroundImage = profile.Tier == SubscriptionTier.Silver ? Resources.Signin_Slot_Silver : Resources.Signin_Slot_Gold, BackgroundImageScaleMode = TileItemImageScaleMode.Stretch, Text = string.Format("<Color=\"black\"><b>{0}</b></Color>", profile.Gamertag)
         };
         ti.RightItemClick += ProfileTile_RightItemClick;
         ti.ItemClick      += ProfileTile_ItemClick;
         ti.Elements.Add(new TileItemElement {
             TextLocation = new Point(0, 15), TextAlignment = TileItemContentAlignment.Manual, Text = string.Format("<Color=\"gray\"><b>{0}</b></Color>", profile.Tier)
         });
         ti.Elements.Add(new TileItemElement {
             TextLocation = new Point(0, 30), TextAlignment = TileItemContentAlignment.Manual, Text = string.Format("<Color=\"gray\"><b>{0}</b></Color>", XtraFunctions.ValueToHex(profile.OfflineXuid.value).Remove(0, 2).PadLeft(16, '0'))
         });
         ti.Elements.Add(new TileItemElement {
             TextLocation = new Point(0, 45), TextAlignment = TileItemContentAlignment.Manual, Text = string.Format("<Color=\"gray\"><b>{0}</b></Color>", XtraFunctions.ValueToHex(profile.OnlineXuid.value).Remove(0, 2).PadLeft(16, '0'))
         });
         SigninTileGroup.Items.Add(ti);
     }
     SigninTileControl.EndUpdate();
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
 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); }
 }
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
0
 static public ulong GetXUID(XDevkit.IXboxConsole xbc, string gamertag)
 {
     XDKUtilities.FIND_USER_INFO_RESPONSE test = XDKUtilities.XUserFindUser(xbc, (ulong)0x0009000006F93463L, gamertag);
     return(test.OnlineXUID);
 }