internal void LoadData(XgdInfo xgdInfo, byte[] dmi, byte[] securitySector,
                               SS.SecuritySector?decodedSecuritySector)
        {
            xboxSecuritySector = securitySector;

            if (xgdInfo != null)
            {
                stkXboxInformation.Visible = true;
                txtXboxL0Video.Text        = $"{xgdInfo.L0Video} sectors";
                txtXboxL1Video.Text        = $"{xgdInfo.L1Video} sectors";
                txtXboxMiddleZone.Text     = $"{xgdInfo.MiddleZone} sectors";
                txtXboxGameSize.Text       = $"{xgdInfo.GameSize} sectors";
                txtXboxTotalSize.Text      = $"{xgdInfo.TotalSize} sectors";
                txtXboxRealBreak.Text      = xgdInfo.LayerBreak.ToString();
            }

            if (dmi != null)
            {
                if (DMI.IsXbox(dmi))
                {
                    grpXboxDmi.Visible = true;
                    txtXboxDmi.Text    = DMI.PrettifyXbox(dmi);
                }
                else if (DMI.IsXbox360(dmi))
                {
                    grpXboxDmi.Visible = true;
                    txtXboxDmi.Text    = DMI.PrettifyXbox360(dmi);
                }
            }

            if (decodedSecuritySector.HasValue)
            {
                grpXboxSs.Visible = true;
                txtXboxSs.Text    = SS.Prettify(decodedSecuritySector);
            }

            btnSaveXboxSs.Visible = securitySector != null;
            Visible = stkXboxInformation.Visible || grpXboxDmi.Visible || grpXboxSs.Visible ||
                      btnSaveXboxSs.Visible;
        }
Example #2
0
        public XboxInfoViewModel([CanBeNull] XgdInfo xgdInfo, [CanBeNull] byte[] dmi, [CanBeNull] byte[] securitySector,
                                 SS.SecuritySector?decodedSecuritySector, Window view)
        {
            _xboxSecuritySector = securitySector;
            _view             = view;
            SaveXboxSsCommand = ReactiveCommand.Create(ExecuteSaveXboxSsCommand);

            if (xgdInfo != null)
            {
                XboxInformationVisible = true;
                XboxL0VideoText        = $"{xgdInfo.L0Video} sectors";
                XboxL1VideoText        = $"{xgdInfo.L1Video} sectors";
                XboxMiddleZoneText     = $"{xgdInfo.MiddleZone} sectors";
                XboxGameSizeText       = $"{xgdInfo.GameSize} sectors";
                XboxTotalSizeText      = $"{xgdInfo.TotalSize} sectors";
                XboxRealBreakText      = xgdInfo.LayerBreak.ToString();
            }

            if (dmi != null)
            {
                if (DMI.IsXbox(dmi))
                {
                    XboxDmiText = DMI.PrettifyXbox(dmi);
                }
                else if (DMI.IsXbox360(dmi))
                {
                    XboxDmiText = DMI.PrettifyXbox360(dmi);
                }
            }

            if (decodedSecuritySector.HasValue)
            {
                XboxSsText = SS.Prettify(decodedSecuritySector);
            }

            SaveXboxSsVisible = securitySector != null;
        }