Beispiel #1
0
        private void PingHostOnPingCompleted(object sender, PingCompletedEventArgs e)
        {
            var ip = (string)e.UserState;

            if (e.Reply == null || e.Reply.Status != IPStatus.Success)
            {
                return;
            }
            var tpConnection     = new TPLinkConnection();
            var smartLinkConnect = new TPLinkConnection.SmartLink {
                LinkAddress = ip
            };
            var moduleInformation = tpConnection.GetModuleInformation(smartLinkConnect);

            if (moduleInformation == null)
            {
                return;
            }
            smartLinkConnect.ModuleInformation = moduleInformation;
            var newModule = new Module(smartLinkConnect)
            {
                Dock = DockStyle.Top
            };

            panel_Modules.Invoke((MethodInvoker) delegate { panel_Modules.Controls.Add(newModule); });
            _smartLinks.Add(newModule);
        }
        private void PingOnPingCompleted(object sender, PingCompletedEventArgs pingCompletedEventArgs)
        {
            var ip = (string)pingCompletedEventArgs.UserState;

            if (pingCompletedEventArgs.Reply != null && pingCompletedEventArgs.Reply.Status == IPStatus.Success)
            {
                // We got a live one here! Check it!
                var tpLinkCommand   = new TPLinkConnection();
                var moduleSmartLink = new TPLinkConnection.SmartLink()
                {
                    LinkPort    = 9999,
                    LinkAddress = ip
                };
                var moduleInformation = tpLinkCommand.GetModuleInformation(moduleSmartLink);

                if (moduleInformation != null)
                {
                    moduleSmartLink.LinkName          = moduleInformation.system.get_sysinfo.alias;
                    moduleSmartLink.ModuleInformation = moduleInformation;
                }
            }
            else if (pingCompletedEventArgs.Reply == null)
            {
            }
            _testedDevices++;
        }
Beispiel #3
0
 public Module(TPLinkConnection.SmartLink moduleSmartLink)
 {
     InitializeComponent();
     txt_ModuleName.Width = toolRw_Module.Width - 300;
     moduleLink           = moduleSmartLink;
     UpdateModuleInformation();
 }
Beispiel #4
0
 public ModuleSettings(TPLinkConnection.SmartLink moduleLink)
 {
     InitializeComponent();
     moduleSmartLink = moduleLink;
 }