Example #1
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 #2
0
 private void SetProperty <T> (NetworkMeasureProperty name, T val) => GetType().GetField(name.ToString()).SetValue(this, val);