private void HostFinderOnHostFound(object sender, HostFoundEventArgs args) { try { if (args.IsCasting) { if (!_isConnected) { axRDPViewer1.SmartSizing = true; axRDPViewer1.Connect(args.ConnectionString, Environment.UserName, ""); } } else if (!args.IsCasting) { if (_isConnected) { axRDPViewer1.Disconnect(); } } } catch (Exception ex) { Debug.WriteLine("Exception:" + ex.Message); } }
protected virtual void OnHostFound(HostFoundEventArgs e) { HostFound?.Invoke(this, e); }