summaryrefslogtreecommitdiff
path: root/windows/WinUI/NetworkRoute.cs
blob: ce26ef7dc06673c842fc2104cef2aaf086a484a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace WinUI
{
    [Serializable]
    public class NetworkRoute : ISerializable
    {
        protected NetworkRoute(SerializationInfo info, StreamingContext ctx)
        {
            Target = info.GetString("target");
            Via = info.GetString("via");
            Flags = info.GetInt32("flags");
            Metric = info.GetInt32("metric");
        }

        public virtual void GetObjectData(SerializationInfo info, StreamingContext ctx)
        {
            info.AddValue("target", Target);
            info.AddValue("via", Via);
            info.AddValue("flags", Flags);
            info.AddValue("metric", Metric);
        }

        [JsonProperty("target")]
        public string Target { get; set; }

        [JsonProperty("via")]
        public string Via { get; set; }

        [JsonProperty("flags")]
        public int Flags { get; set; }

        [JsonProperty("metric")]
        public int Metric { get; set; }
    }
}