Added usage and "Go To Site" menus per account
[pithos-ms-client] / trunk / Pithos.Network / AccountInfo.cs
1 using System;
2
3 namespace Pithos.Network
4 {
5     public class AccountInfo
6     {
7         public string UserName { get; set; }
8         public string Token { get; set; }
9         public Uri StorageUri { get; set; }
10         
11         private string _accountPath;
12         public string AccountPath
13         {
14             get { return _accountPath; }
15             set { _accountPath = value.ToLower(); }
16         }
17
18         public int BlockSize { get; set; }
19
20         public string BlockHash { get; set; }
21
22         public long Quota { get; set; }
23
24         public long BytesUsed { get; set; }
25
26
27         public string Usage
28         {
29             get
30             {
31                 var gigabytes = Quota / 1073741824;
32                 var percentage = BytesUsed / (double)Quota;
33                 return String.Format("{0:P0} of {1} GB", percentage, gigabytes);
34             }
35
36         }
37
38         public string SiteUri { get; set; }
39     }
40 }