Пример #1
0
        private Dictionary<string, object> SerializeRangeBucket(IpRangeBucket bucket)
        {
            Dictionary<string, object> bucketDict = new Dictionary<string, object>();
            bucketDict.AddObject(_TO, bucket.To);
            bucketDict.AddObject(_FROM, bucket.From);

            return bucketDict;
        }
Пример #2
0
        private IpRangeBucket DeserializeRangeBucket(Dictionary<string, object> bucketDict)
        {
            IpRangeBucket bucket = new IpRangeBucket();
            if (bucketDict.ContainsKey(_TO))
                bucket.To = bucketDict.GetString(_TO);
            if (bucketDict.ContainsKey(_FROM))
                bucket.From = bucketDict.GetString(_FROM);

            return bucket;
        }