Esempio n. 1
0
    private void onExportObjectSelected(ExportTableEntrySelectedMessage message) {
      export = message.ExportTableEntry;

      viewModel.Properties.ForEach(p => p.PropertyChanged -= onPropertyChanged);

      viewModel.Properties = new ObservableCollection<PropertyViewEntity>(mapper.Map<IEnumerable<PropertyViewEntity>>(export.DomainObject.PropertyHeader.Properties));

      viewModel.Properties.ForEach(p => p.PropertyChanged += onPropertyChanged);
    }
Esempio n. 2
0
    private void onExportObjectSelected(ExportTableEntrySelectedMessage message) {
      if (message.ExportTableEntry.DomainObject == null) return;

      switch(message.ExportTableEntry.DomainObject.Viewable) {
        case ViewableTypes.Sound: {
          Task.Run(() => playSound(message.ExportTableEntry.DomainObject.GetObjectStream(), resetToken())).FireAndForget();

          break;
        }
        case ViewableTypes.Image: {
          texture = message.ExportTableEntry.DomainObject as DomainObjectTexture2D;

          if (texture != null) {
            clearViewModel();

            viewModel.MipMaps = new ObservableCollection<MipMapViewEntity>(mapper.Map<IEnumerable<MipMapViewEntity>>(texture.MipMaps));

            for(int i = 0; i < viewModel.MipMaps.Count; ++i) {
              viewModel.MipMaps[i].Level = i + 1;

              viewModel.MipMaps[i].PropertyChanged += onMipMapViewEntityChanged;
            }

            MipMapViewEntity largest = viewModel.MipMaps.Aggregate((i1, i2) => i1 != null && i1.IsEnabled & (i1.Width > i2.Width || i1.Height > i2.Height) ? i1 : (i2.IsEnabled ? i2 : null));

            if (largest != null) largest.IsChecked = true;
          }

          break;
        }
        default: {
          clearViewModel();

          break;
        }
      }
    }
Esempio n. 3
0
    private void onExportTableEntrySelected(ExportTableEntrySelectedMessage message) {
      viewModel.Title = message.ExportTableEntry.NameTableIndex.Name;

      title = viewModel.Title;

      if (!menuViewModel.IsHexViewObject && message.ExportTableEntry.DomainObject?.AdditionalDataReader != null) {
        Task.Run(() => buildHexDataAsync(message.ExportTableEntry.DomainObject.AdditionalDataReader.GetBytes(), message.ExportTableEntry.DomainObject.AdditionalDataOffset, resetToken())).FireAndForget();
      }
      else {
        Task.Run(() => buildHexDataAsync(message.ExportTableEntry.DomainObjectReader.GetBytes(), message.ExportTableEntry.SerialDataOffset, resetToken())).FireAndForget();
      }
    }