Example #1
0
 public NetworkMeasure(Octet totalDownload, Octet totalUpload, Octet downloadRate, Octet uploadRate, Octet trafficMaxLimit, int startDay, DateTime dateTime)
 {
     this.CurrentDownload = totalDownload;
     this.CurrentUpload   = totalUpload;
     this.DownloadRate    = downloadRate;
     this.UploadRate      = uploadRate;
     this.TrafficMaxLimit = trafficMaxLimit;
     this.StartDay        = startDay;
     this.DateTime        = dateTime;
 }
Example #2
0
        public void SetProperty(NetworkMeasureProperty prop, string val)
        {
            long dbVal = long.Parse(val);

            switch (prop)
            {
            case NetworkMeasureProperty.DownloadRate:
            case NetworkMeasureProperty.CurrentDownload:
            case NetworkMeasureProperty.CurrentUpload:
            case NetworkMeasureProperty.UploadRate:
            case NetworkMeasureProperty.TrafficMaxLimit:
                SetProperty(prop, Octet.FromOctet(dbVal));
                break;

            case NetworkMeasureProperty.StartDay:
                SetProperty(prop, Convert.ToInt32(dbVal));
                break;
            }
        }
Example #3
0
 public static Octet FromTera(long tera) => Octet.FromGiga(tera * coef);
Example #4
0
 public static Octet FromGiga(long giga) => Octet.FromMega(giga * coef);
Example #5
0
 public static Octet FromMega(long mega) => Octet.FromKilo(mega * coef);
Example #6
0
 public static Octet FromKilo(long kilo) => Octet.FromOctet(kilo * coef);
Example #7
0
 public static Octet operator /(Octet a, long b)
 {
     return(Octet.FromOctet(a.GetOctets() / b));
 }
Example #8
0
 public static Octet operator -(Octet a, Octet b)
 {
     return(Octet.FromOctet(a.GetOctets() - b.GetOctets()));
 }