Exemplo n.º 1
0
        private void mnuProfileSettings_Click(object sender, EventArgs e)
        {
            using (frmSettings frm = new frmSettings(_node, Path.GetDirectoryName(_profileFilePath), _isPortableApp))
            {
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    if (frm.PasswordChangeRequest)
                    {
                        _node.ChangePassword(frm.Password);
                    }

                    _node.DownloadFolder                   = frm.DownloadFolder;
                    _node.LocalServicePort                 = frm.Port;
                    _node.AllowInboundInvitations          = frm.AllowInboundInvitations;
                    _node.AllowOnlyLocalInboundInvitations = frm.AllowOnlyLocalInboundInvitations;
                    _node.EnableUPnP = frm.EnableUPnP;

                    if (frm.EnableProxy)
                    {
                        _node.ConfigureProxy(frm.ProxyType, frm.ProxyAddress, frm.ProxyPort, frm.ProxyCredentials);
                    }
                    else
                    {
                        _node.DisableProxy();
                    }

                    SaveProfile();
                }
            }
        }