public NetworkAutoplay(InterfaceInformation interfaceInfo)
 {
     savedInterfaces = SavedInterface.Deserialize();
     inf             = interfaceInfo;
     InitializeComponent();
     lblNetworkAdapterName.Content = inf.Name;
     lblCurrentIPAddress.Content   = inf.IPAddress;
     fillInSavedInterfaceList();
     this.Topmost = true;
     this.Show();
     this.MouseDown += NetworkAutoplay_MouseDown;
 }
Beispiel #2
0
        public MainWindow()
        {
            InitializeComponent();
            interfaces      = InterfaceInformation.Deserialize();
            savedInterfaces = SavedInterface.Deserialize();

            updateAllInterfaces();
            listInterfaces.ItemsSource = interfaces;

            networkInterfaces = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces();
            System.Timers.Timer t = new System.Timers.Timer();
            t.Interval = 1000;
            t.Elapsed += delegate
            {
                IPConfig.SetInterfaceState(interfaces);
            };
            t.Start();
        }