-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
6c64fc7
commit 5bcb65f
Showing
5 changed files
with
136 additions
and
41 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
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
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,34 @@ | ||
using System; | ||
|
||
namespace UI; | ||
|
||
public class ProcessDTO | ||
{ | ||
public string Name { get; set; } | ||
public long Memory { get; set; } | ||
public string MemoryStr | ||
{ | ||
get | ||
{ | ||
string[] suffixes = { " B", " KB", " MB", " GB", " TB", " PB" }; | ||
|
||
for (int i = 0; i < suffixes.Length; i++) | ||
{ | ||
long temp = Memory / (int)Math.Pow(1024, i + 1); | ||
|
||
if (temp == 0) | ||
{ | ||
return (Memory / (int)Math.Pow(1024, i)) + suffixes[i]; | ||
} | ||
} | ||
|
||
return Memory.ToString(); | ||
} | ||
} | ||
|
||
public ProcessDTO(string name, long memory) | ||
{ | ||
Name = name; | ||
Memory = memory; | ||
} | ||
} |
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
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