public static void Reset(this AssetPropertiesViewModel vm) { Application.Current.Dispatcher.Invoke(delegate { vm.AssetName = string.Empty; vm.PartOf = string.Empty; vm.IncludedExtensions = string.Empty; vm.Offsets = string.Empty; vm.TotalSize = string.Empty; vm.IsEncrypted = string.Empty; vm.CompMethod = string.Empty; }); }
public static void Set(this AssetPropertiesViewModel vm, FPakEntry entry) { Application.Current.Dispatcher.Invoke(delegate { string ext = string.Join(" ", entry.GetExtension(), entry.Uexp?.GetExtension(), entry.Ubulk?.GetExtension()); string offsets = string.Join(" ", "0x" + (entry.Offset + entry.StructSize).ToString("X2"), entry.Uexp != null ? "0x" + (entry.Uexp.Offset + entry.StructSize).ToString("X2") : string.Empty, entry.Ubulk != null ? "0x" + (entry.Ubulk.Offset + entry.StructSize).ToString("X2") : string.Empty); string tSize = Strings.GetReadableSize(entry.Size + (entry.Uexp?.Size ?? 0) + (entry.Ubulk?.Size ?? 0)); vm.AssetName = entry.GetNameWithExtension(); vm.PartOf = entry.PakFileName; vm.IncludedExtensions = ext.TrimEnd(); vm.Offsets = offsets.TrimEnd(); vm.TotalSize = tSize; vm.IsEncrypted = entry.Encrypted ? Properties.Resources.Yes : Properties.Resources.No; vm.CompMethod = ((ECompressionFlags)entry.CompressionMethodIndex).ToString(); }); }
public static void Set(this AssetPropertiesViewModel vm, ReaderEntry entry) { Application.Current.Dispatcher.Invoke(delegate { string ext = string.Join(" ", entry.GetExtension(), entry.Uexp?.GetExtension(), entry.Ubulk?.GetExtension()); string offsets; string tSize; if (entry is ReaderEntry pakEntry) { offsets = string.Join(" ", "0x" + (pakEntry.Offset + pakEntry.StructSize).ToString("X2"), entry.Uexp != null ? "0x" + (pakEntry.Uexp?.Offset + pakEntry.StructSize)?.ToString("X2") : string.Empty, entry.Ubulk != null ? "0x" + (pakEntry.Ubulk?.Offset + pakEntry.StructSize)?.ToString("X2") : string.Empty); tSize = Strings.GetReadableSize(pakEntry.Size + (pakEntry.Uexp?.Size ?? 0) + (pakEntry.Ubulk?.Size ?? 0)); } else { offsets = string.Empty; tSize = string.Empty; } vm.AssetName = entry.GetNameWithExtension(); vm.PartOf = entry.ContainerName; vm.IncludedExtensions = ext.TrimEnd(); vm.Offsets = offsets.TrimEnd(); vm.TotalSize = tSize; if (entry is FPakEntry c1) { vm.IsEncrypted = c1.Encrypted ? Properties.Resources.Yes : Properties.Resources.No; vm.CompMethod = ((ECompressionFlags)c1.CompressionMethodIndex).ToString(); } else if (entry is FIoStoreEntry c2) { vm.IsEncrypted = c2.Encrypted ? Properties.Resources.Yes : Properties.Resources.No; vm.CompMethod = c2.CompressionMethodString; } });