Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit880b8ba

Browse files
authored
Merge pull request#109 from sandermvanvliet/master
Show bytes suffix when data is less than 1kb - thank to@sandermvanvliet
2 parents1761d75 +153923c commit880b8ba

File tree

4 files changed

+141
-113
lines changed

4 files changed

+141
-113
lines changed

‎Sources/WPFHexaEditor/HexEditor.xaml.cs‎

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3837,21 +3837,26 @@ private void UpdateStatusBar(bool updateFilelength = true)
38373837
#region Show length
38383838
if(updateFilelength)
38393839
{
3840-
varisMegabByte=false;
3840+
doublelength;
3841+
stringunit;
38413842

3842-
//is mega bytes ?
3843-
doublelength=_provider.LengthAjusted/1024;
3844-
3845-
if(length>1024)
3843+
if(_provider.LengthAjusted<1024)
3844+
{
3845+
length=_provider.LengthAjusted;
3846+
unit=Properties.Resources.BytesTagString;
3847+
}
3848+
elseif(_provider.LengthAjusted<1048576)// 1048576 bytes = 1 MiB
3849+
{
3850+
length=_provider.LengthAjusted/1024;
3851+
unit=Properties.Resources.KBTagString;
3852+
}
3853+
else
38463854
{
3847-
length/=1024;
3848-
isMegabByte=true;
3855+
length=_provider.LengthAjusted/1048576;
3856+
unit=Properties.Resources.MBTagString;
38493857
}
38503858

3851-
FileLengthKbLabel.Content=Math.Round(length,2)+
3852-
(isMegabByte
3853-
?$"{Properties.Resources.MBTagString}"
3854-
:$"{Properties.Resources.KBTagString}");
3859+
FileLengthKbLabel.Content=Math.Round(length,2)+" "+unit;
38553860
}
38563861
#endregion
38573862

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp