Compare commits
No commits in common. "master" and "3aeaef9229974cfe4399ead409c507672e5fc2a5" have entirely different histories.
master
...
3aeaef9229
1
App.xaml
1
App.xaml
@ -33,7 +33,6 @@
|
||||
<BooleanToVisibilityConverter />
|
||||
</c:ValueConverterAggregate>
|
||||
<c:MultiValueEqualityConverter x:Key="MultiValueEqualityConverter" />
|
||||
<c:SizeConverter x:Key="SizeConverter" />
|
||||
<Style x:Key="CommonStyle" TargetType="Control">
|
||||
<Setter
|
||||
Property="Foreground"
|
||||
|
@ -19,8 +19,6 @@ namespace HashCalculator.GUI
|
||||
public string InstanceIdString { get; }
|
||||
public string TypeIdString { get; }
|
||||
|
||||
public int Size { get; }
|
||||
|
||||
public string LocalizedNames
|
||||
{
|
||||
get
|
||||
@ -123,7 +121,6 @@ namespace HashCalculator.GUI
|
||||
}
|
||||
InstanceIdString = $"{InstanceId:x8} ({InstanceId,10})";
|
||||
TypeIdString = $"{TypeId:x8} ({TypeId,10})";
|
||||
Size = asset.InstanceDataSize;
|
||||
}
|
||||
|
||||
private AssetEntry(string kind, string type)
|
||||
|
@ -175,7 +175,6 @@ namespace HashCalculator.GUI
|
||||
}).ConfigureAwait(true);
|
||||
AddEntries(entries);
|
||||
ViewModel.StatusText = $"Manifest文件读取完毕,加载了{_loadedAssets.Count}个素材";
|
||||
ViewModel.SizeAvailable = true;
|
||||
}
|
||||
|
||||
public async Task CancelLoadingXml()
|
||||
@ -211,7 +210,6 @@ namespace HashCalculator.GUI
|
||||
};
|
||||
ViewModel.IsXml = true;
|
||||
ViewModel.IsXsd = type == InputEntryType.XsdFile;
|
||||
ViewModel.SizeAvailable = false;
|
||||
var task = LoadXmlInternal(await modXml, tokenSource.Token);
|
||||
_lastXmlTask = (tokenSource, task).ToTuple();
|
||||
|
||||
|
@ -1,33 +0,0 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace HashCalculator.GUI.Converters
|
||||
{
|
||||
internal class SizeConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var size = (int)value;
|
||||
var suffixes = new[]
|
||||
{
|
||||
(1024, 1.0, ""),
|
||||
(1024 * 1024, 1024.0, "K"),
|
||||
(1024 * 1024 * 1024, 1024 * 1024.0, "M"),
|
||||
};
|
||||
foreach (var (limit, divisor, suffix) in suffixes)
|
||||
{
|
||||
if (size < limit)
|
||||
{
|
||||
return $"{size / divisor:0.00}{suffix}B";
|
||||
}
|
||||
}
|
||||
return $"{size / (1024.0 * 1024.0 * 1024.0):0.00}GB";
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@ -291,14 +291,6 @@
|
||||
Path=DataContext.ConsiderTypeId,
|
||||
Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
/>
|
||||
<DataGridTextColumn
|
||||
Header="大小"
|
||||
Binding="{Binding Size, Converter={StaticResource SizeConverter}}"
|
||||
FontFamily="Courier New"
|
||||
Visibility="{Binding Source={x:Reference Name=ReferenceProvider},
|
||||
Path=DataContext.SizeAvailable,
|
||||
Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</DockPanel>
|
||||
|
@ -150,12 +150,8 @@ namespace HashCalculator.GUI
|
||||
else
|
||||
{
|
||||
var previousPath = _assets[item];
|
||||
if(!fullPath.Contains("SageXml"))
|
||||
{
|
||||
TracerListener.WriteLine($"[ModXml] `{fullPath}`: Attempted to add item `{item.Type}:{item.Name}` multiple times - already processed in `{previousPath}`");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
await Task.WhenAll(includesTasks);
|
||||
|
@ -89,13 +89,6 @@ namespace HashCalculator.GUI
|
||||
set => SetField(ref _considerTypeId, value, () => GameObjectOnly &= !value);
|
||||
}
|
||||
|
||||
private bool _sizeAvailable;
|
||||
public bool SizeAvailable
|
||||
{
|
||||
get => _sizeAvailable;
|
||||
set => SetField(ref _sizeAvailable, value);
|
||||
}
|
||||
|
||||
public Command FilterDisplayEntries { get; }
|
||||
|
||||
private int _totalCount;
|
||||
|
Loading…
x
Reference in New Issue
Block a user