Exemplo n.º 1
0
        public BlurayInfoViewModel([CanBeNull] byte[] blurayDiscInformation, [CanBeNull] byte[] blurayBurstCuttingArea,
                                   [CanBeNull] byte[] blurayDds, [CanBeNull] byte[] blurayCartridgeStatus,
                                   [CanBeNull] byte[] bluraySpareAreaInformation, [CanBeNull] byte[] blurayPowResources,
                                   [CanBeNull] byte[] blurayTrackResources, [CanBeNull] byte[] blurayRawDfl,
                                   [CanBeNull] byte[] blurayPac, Window view)
        {
            _view             = view;
            _discInformation  = blurayDiscInformation;
            _burstCuttingArea = blurayBurstCuttingArea;
            _dds                              = blurayDds;
            _cartridgeStatus                  = blurayCartridgeStatus;
            _spareAreaInformation             = bluraySpareAreaInformation;
            _powResources                     = blurayPowResources;
            _trackResources                   = blurayTrackResources;
            _rawDfl                           = blurayRawDfl;
            _pac                              = blurayPac;
            SaveBlurayDiscInformationCommand  = ReactiveCommand.Create(ExecuteSaveBlurayDiscInformationCommand);
            SaveBlurayBurstCuttingAreaCommand = ReactiveCommand.Create(ExecuteSaveBlurayBurstCuttingAreaCommand);
            SaveBlurayDdsCommand              = ReactiveCommand.Create(ExecuteSaveBlurayDdsCommand);
            SaveBlurayCartridgeStatusCommand  = ReactiveCommand.Create(ExecuteSaveBlurayCartridgeStatusCommand);

            SaveBluraySpareAreaInformationCommand =
                ReactiveCommand.Create(ExecuteSaveBluraySpareAreaInformationCommand);

            SaveBlurayPowResourcesCommand   = ReactiveCommand.Create(ExecuteSaveBlurayPowResourcesCommand);
            SaveBlurayTrackResourcesCommand = ReactiveCommand.Create(ExecuteSaveBlurayTrackResourcesCommand);
            SaveBlurayRawDflCommand         = ReactiveCommand.Create(ExecuteSaveBlurayRawDflCommand);
            SaveBlurayPacCommand            = ReactiveCommand.Create(ExecuteSaveBlurayPacCommand);

            if (blurayDiscInformation != null)
            {
                SaveBlurayDiscInformationVisible = true;
                BlurayDiscInformationText        = DI.Prettify(blurayDiscInformation);
            }

            if (blurayBurstCuttingArea != null)
            {
                SaveBlurayBurstCuttingAreaVisible = true;
                BlurayBurstCuttingAreaText        = BCA.Prettify(blurayBurstCuttingArea);
            }

            if (blurayDds != null)
            {
                SaveBlurayDdsVisible = true;
                BlurayDdsText        = DDS.Prettify(blurayDds);
            }

            if (blurayCartridgeStatus != null)
            {
                SaveBlurayCartridgeStatusVisible = true;
                BlurayCartridgeStatusText        = Cartridge.Prettify(blurayCartridgeStatus);
            }

            if (bluraySpareAreaInformation != null)
            {
                SaveBluraySpareAreaInformationVisible = true;
                BluraySpareAreaInformationText        = Spare.Prettify(bluraySpareAreaInformation);
            }

            if (blurayPowResources != null)
            {
                SaveBlurayPowResourcesVisible = true;
                BlurayPowResourcesText        = DiscInformation.Prettify(blurayPowResources);
            }

            if (blurayTrackResources != null)
            {
                SaveBlurayTrackResourcesVisible = true;
                BlurayTrackResourcesText        = DiscInformation.Prettify(blurayTrackResources);
            }

            SaveBlurayRawDflVisible = blurayRawDfl != null;
            SaveBlurayPacVisible    = blurayPac != null;
        }
Exemplo n.º 2
0
        internal void LoadData(byte[] blurayDiscInformation, byte[] blurayBurstCuttingArea, byte[] blurayDds,
                               byte[] blurayCartridgeStatus, byte[] bluraySpareAreaInformation,
                               byte[] blurayPowResources, byte[] blurayTrackResources, byte[] blurayRawDfl,
                               byte[] blurayPac)
        {
            DiscInformation  = blurayDiscInformation;
            BurstCuttingArea = blurayBurstCuttingArea;
            Dds                  = blurayDds;
            CartridgeStatus      = blurayCartridgeStatus;
            SpareAreaInformation = bluraySpareAreaInformation;
            PowResources         = blurayPowResources;
            TrackResources       = blurayTrackResources;
            RawDfl               = blurayRawDfl;
            Pac                  = blurayPac;

            if (blurayDiscInformation != null)
            {
                grpBlurayDiscInformation.Visible     = true;
                btnSaveBlurayDiscInformation.Visible = true;
                txtBlurayDiscInformation.Text        = DI.Prettify(blurayDiscInformation);
            }

            if (blurayBurstCuttingArea != null)
            {
                grpBlurayBurstCuttingArea.Visible     = true;
                btnSaveBlurayBurstCuttingArea.Visible = true;
                txtBlurayBurstCuttingArea.Text        = BCA.Prettify(blurayBurstCuttingArea);
            }

            if (blurayDds != null)
            {
                grpBlurayDds.Visible     = true;
                btnSaveBlurayDds.Visible = true;
                txtBlurayDds.Text        = DDS.Prettify(blurayDds);
            }

            if (blurayCartridgeStatus != null)
            {
                grpBlurayCartridgeStatus.Visible     = true;
                btnSaveBlurayCartridgeStatus.Visible = true;
                txtBlurayCartridgeStatus.Text        = Cartridge.Prettify(blurayCartridgeStatus);
            }

            if (bluraySpareAreaInformation != null)
            {
                grpBluraySpareAreaInformation.Visible     = true;
                btnSaveBluraySpareAreaInformation.Visible = true;
                txtBluraySpareAreaInformation.Text        = Spare.Prettify(bluraySpareAreaInformation);
            }

            if (blurayPowResources != null)
            {
                grpBlurayPowResources.Visible     = true;
                btnSaveBlurayPowResources.Visible = true;
                txtBlurayPowResources.Text        = Decoders.SCSI.MMC.DiscInformation.Prettify(blurayPowResources);
            }

            if (blurayTrackResources != null)
            {
                grpBlurayTrackResources.Visible     = true;
                btnSaveBlurayTrackResources.Visible = true;
                txtBlurayTrackResources.Text        = Decoders.SCSI.MMC.DiscInformation.Prettify(blurayTrackResources);
            }

            btnSaveBlurayRawDfl.Visible = blurayRawDfl != null;
            btnSaveBlurayPac.Visible    = blurayPac != null;

            Visible = grpBlurayDiscInformation.Visible || grpBlurayBurstCuttingArea.Visible ||
                      grpBlurayDds.Visible ||
                      grpBlurayCartridgeStatus.Visible || grpBluraySpareAreaInformation.Visible ||
                      grpBlurayPowResources.Visible || grpBlurayTrackResources.Visible ||
                      btnSaveBlurayRawDfl.Visible ||
                      btnSaveBlurayPac.Visible;
        }