This repository has been archived by the owner on Nov 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,893 changed files
with
328,107 additions
and
5,159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Returns the human-readable file size for an arbitrary, 64-bit file size | ||
// The default format is "0.### XB", e.g. "4.2 KB" or "1.434 GB" | ||
public string GetBytesReadable(long i) | ||
{ | ||
// Get absolute value | ||
long absolute_i = (i < 0 ? -i : i); | ||
// Determine the suffix and readable value | ||
string suffix; | ||
double readable; | ||
if (absolute_i >= 0x1000000000000000) // Exabyte | ||
{ | ||
suffix = "EB"; | ||
readable = (i >> 50); | ||
} | ||
else if (absolute_i >= 0x4000000000000) // Petabyte | ||
{ | ||
suffix = "PB"; | ||
readable = (i >> 40); | ||
} | ||
else if (absolute_i >= 0x10000000000) // Terabyte | ||
{ | ||
suffix = "TB"; | ||
readable = (i >> 30); | ||
} | ||
else if (absolute_i >= 0x40000000) // Gigabyte | ||
{ | ||
suffix = "GB"; | ||
readable = (i >> 20); | ||
} | ||
else if (absolute_i >= 0x100000) // Megabyte | ||
{ | ||
suffix = "MB"; | ||
readable = (i >> 10); | ||
} | ||
else if (absolute_i >= 0x400) // Kilobyte | ||
{ | ||
suffix = "KB"; | ||
readable = i; | ||
} | ||
else | ||
{ | ||
return i.ToString("0 B"); // Byte | ||
} | ||
// Divide by 1024 to get fractional value | ||
readable = (readable / 1024); | ||
// Return formatted number with suffix | ||
return readable.ToString("0.### ") + suffix; | ||
} | ||
|
||
https://stackoverflow.com/questions/281640/how-do-i-get-a-human-readable-file-size-in-bytes-abbreviation-using-net |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...mos/NuGet Enabled/Krypton Docking Examples/Docking Customized/ContentDocument.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
Source/Demos/NuGet Enabled/Krypton Docking Examples/Docking Customized/ContentDocument.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// ***************************************************************************** | ||
// | ||
// © Component Factory Pty Ltd 2012 - 2019. All rights reserved. | ||
// The software and associated documentation supplied hereunder are the | ||
// proprietary information of Component Factory Pty Ltd, PO Box 1504, | ||
// Glen Waverley, Vic 3150, Australia and are supplied subject to licence terms. | ||
// | ||
// Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV) 2017 - 2019. All rights reserved. (https://github.com/Wagnerp/Krypton-NET-5.480) | ||
// Version 5.480.0.0 www.ComponentFactory.com | ||
// | ||
// ***************************************************************************** | ||
|
||
using System.Windows.Forms; | ||
|
||
namespace DockingCustomized | ||
{ | ||
public partial class ContentDocument : UserControl | ||
{ | ||
public ContentDocument() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
145 changes: 145 additions & 0 deletions
145
.../Demos/NuGet Enabled/Krypton Docking Examples/Docking Customized/ContentInput.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.