Exemplo n.º 1
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this);

            this.Icon = Properties.Resources.KeePass;

            ProxyServerType pst = Program.Config.Integration.ProxyType;

            if (pst == ProxyServerType.None)
            {
                m_rbNoProxy.Checked = true;
            }
            else if (pst == ProxyServerType.Manual)
            {
                m_rbManualProxy.Checked = true;
            }
            else
            {
                m_rbSystemProxy.Checked = true;
            }

            m_tbAddress.Text = Program.Config.Integration.ProxyAddress;
            m_tbPort.Text    = Program.Config.Integration.ProxyPort;

            m_tbUser.Text     = Program.Config.Integration.ProxyUserName;
            m_tbPassword.Text = Program.Config.Integration.ProxyPassword;
        }
Exemplo n.º 2
0
        private void OnBtnOK(object sender, EventArgs e)
        {
            ProxyServerType pst = ProxyServerType.System;

            if (m_rbNoProxy.Checked)
            {
                pst = ProxyServerType.None;
            }
            else if (m_rbManualProxy.Checked)
            {
                pst = ProxyServerType.Manual;
            }

            ProxyAuthType pat = ProxyAuthType.Default;

            if (m_rbAuthNone.Checked)
            {
                pat = ProxyAuthType.None;
            }
            else if (m_rbAuthManual.Checked)
            {
                pat = ProxyAuthType.Manual;
            }

            AceIntegration ace = Program.Config.Integration;

            ace.ProxyType     = pst;
            ace.ProxyAddress  = m_tbAddress.Text;
            ace.ProxyPort     = m_tbPort.Text;
            ace.ProxyAuthType = pat;
            ace.ProxyUserName = m_tbUser.Text;
            ace.ProxyPassword = m_tbPassword.TextEx.ReadString();

            Program.Config.Apply(AceApplyFlags.Proxy);
        }
        /// <summary>
        /// Initializes a new instance of <see cref="HttpUrlSettings" /> class with specified HTTP url parameters.
        /// </summary>
        /// <param name="value">HTTP url parameters.</param>
        /// <exception cref="ArgumentNullException">
        /// <para>The <paramref name="value"/> is <see langword="null"/>.</para>
        /// </exception>
        public HttpUrlSettings(String value)
            : base(value)
        {
            this.ServerAuthenticate      = HttpUrl.DefaultHttpServerAuthenticate;
            this.ProxyServerAuthenticate = HttpUrl.DefaultHttpProxyServerAuthenticate;

            var parameters = GetParameters(value);

            var ovSettings = OnlineVideoSettings.Instance;

            this.OpenConnectionTimeout        = GetValue(parameters, "OpenConnectionTimeout", ovSettings.HttpOpenConnectionTimeout);
            this.OpenConnectionSleepTime      = GetValue(parameters, "OpenConnectionSleepTime", ovSettings.HttpOpenConnectionSleepTime);
            this.TotalReopenConnectionTimeout = GetValue(parameters, "TotalReopenConnectionTimeout", ovSettings.HttpTotalReopenConnectionTimeout);

            this.ServerAuthenticate = GetValue(parameters, "ServerAuthenticate", ovSettings.HttpServerAuthenticate);
            this.ServerUserName     = GetValue(parameters, "ServerUserName", ovSettings.HttpServerUserName);
            this.ServerPassword     = GetValue(parameters, "ServerPassword", ovSettings.HttpServerPassword);

            this.ProxyServerAuthenticate = GetValue(parameters, "ProxyServerAuthenticate", ovSettings.HttpProxyServerAuthenticate);
            this.ProxyServer             = GetValue(parameters, "ProxyServer", ovSettings.HttpProxyServer);
            this.ProxyServerPort         = GetValue(parameters, "ProxyServerPort", ovSettings.HttpProxyServerPort);
            this.ProxyServerUserName     = GetValue(parameters, "ProxyServerUserName", ovSettings.HttpProxyServerUserName);
            this.ProxyServerPassword     = GetValue(parameters, "ProxyServerPassword", ovSettings.HttpProxyServerPassword);
            this.ProxyServerType         = (ProxyServerType)GetValue(parameters, "ProxyServerType", (int)ovSettings.HttpProxyServerType);
        }
Exemplo n.º 4
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            GlobalWindowManager.AddWindow(this);

            this.Icon = AppIcons.Default;

            ProxyServerType pst = Program.Config.Integration.ProxyType;

            if (pst == ProxyServerType.None)
            {
                m_rbNoProxy.Checked = true;
            }
            else if (pst == ProxyServerType.Manual)
            {
                m_rbManualProxy.Checked = true;
            }
            else
            {
                m_rbSystemProxy.Checked = true;
            }

            m_tbAddress.Text = Program.Config.Integration.ProxyAddress;
            m_tbPort.Text    = Program.Config.Integration.ProxyPort;

            string strUserName = Program.Config.Integration.ProxyUserName;
            string strPassword = Program.Config.Integration.ProxyPassword;

            ProxyAuthType pat = Program.Config.Integration.ProxyAuthType;

            if (pat == ProxyAuthType.Auto)
            {
                if ((strUserName.Length > 0) || (strPassword.Length > 0))
                {
                    pat = ProxyAuthType.Manual;
                }
                else
                {
                    pat = ProxyAuthType.Default;
                }
            }

            if (pat == ProxyAuthType.None)
            {
                m_rbAuthNone.Checked = true;
            }
            else if (pat == ProxyAuthType.Manual)
            {
                m_rbAuthManual.Checked = true;
            }
            else
            {
                m_rbAuthDefault.Checked = true;
            }

            m_tbUser.Text     = strUserName;
            m_tbPassword.Text = strPassword;

            EnableControlsEx();
        }
Exemplo n.º 5
0
 public static void SetProxy(ProxyServerType pst, string strAddr,
                             string strPort, string strUserName, string strPassword)
 {
     m_pstProxyType     = pst;
     m_strProxyAddr     = (strAddr ?? string.Empty);
     m_strProxyPort     = (strPort ?? string.Empty);
     m_strProxyUserName = (strUserName ?? string.Empty);
     m_strProxyPassword = (strPassword ?? string.Empty);
 }
Exemplo n.º 6
0
        private void OnBtnOK(object sender, EventArgs e)
        {
            ProxyServerType pst = ProxyServerType.System;

            if (m_rbNoProxy.Checked)
            {
                pst = ProxyServerType.None;
            }
            else if (m_rbManualProxy.Checked)
            {
                pst = ProxyServerType.Manual;
            }

            AceIntegration ace = Program.Config.Integration;

            ace.ProxyType     = pst;
            ace.ProxyAddress  = m_tbAddress.Text;
            ace.ProxyPort     = m_tbPort.Text;
            ace.ProxyUserName = m_tbUser.Text;
            ace.ProxyPassword = m_tbPassword.Text;

            IOConnection.SetProxy(pst, ace.ProxyAddress, ace.ProxyPort,
                                  ace.ProxyUserName, ace.ProxyPassword);
        }
Exemplo n.º 7
0
        internal static void SetProxy(ProxyServerType pst, string strAddr,
			string strPort, ProxyAuthType pat, string strUserName,
			string strPassword)
        {
            m_pstProxyType = pst;
            m_strProxyAddr = (strAddr ?? string.Empty);
            m_strProxyPort = (strPort ?? string.Empty);
            m_patProxyAuthType = pat;
            m_strProxyUserName = (strUserName ?? string.Empty);
            m_strProxyPassword = (strPassword ?? string.Empty);
        }
        /// <summary>
        /// Initializes a new instance of <see cref="HttpUrlSettings" /> class with specified HTTP url parameters.
        /// </summary>
        /// <param name="value">HTTP url parameters.</param>
        /// <exception cref="ArgumentNullException">
        /// <para>The <paramref name="value"/> is <see langword="null"/>.</para>
        /// </exception>
        public HttpUrlSettings(String value)
            : base(value)
        {
            this.ServerAuthenticate = HttpUrl.DefaultHttpServerAuthenticate;
            this.ProxyServerAuthenticate = HttpUrl.DefaultHttpProxyServerAuthenticate;

            var parameters = GetParameters(value);

            var ovSettings = OnlineVideoSettings.Instance;

            this.OpenConnectionTimeout = GetValue(parameters, "OpenConnectionTimeout", ovSettings.HttpOpenConnectionTimeout);
            this.OpenConnectionSleepTime = GetValue(parameters, "OpenConnectionSleepTime", ovSettings.HttpOpenConnectionSleepTime);
            this.TotalReopenConnectionTimeout = GetValue(parameters, "TotalReopenConnectionTimeout", ovSettings.HttpTotalReopenConnectionTimeout);

            this.ServerAuthenticate = GetValue(parameters, "ServerAuthenticate", ovSettings.HttpServerAuthenticate);
            this.ServerUserName = GetValue(parameters, "ServerUserName", ovSettings.HttpServerUserName);
            this.ServerPassword = GetValue(parameters, "ServerPassword", ovSettings.HttpServerPassword);

            this.ProxyServerAuthenticate = GetValue(parameters, "ProxyServerAuthenticate", ovSettings.HttpProxyServerAuthenticate);
            this.ProxyServer = GetValue(parameters, "ProxyServer", ovSettings.HttpProxyServer);
            this.ProxyServerPort = GetValue(parameters, "ProxyServerPort", ovSettings.HttpProxyServerPort);
            this.ProxyServerUserName = GetValue(parameters, "ProxyServerUserName", ovSettings.HttpProxyServerUserName);
            this.ProxyServerPassword = GetValue(parameters, "ProxyServerPassword", ovSettings.HttpProxyServerPassword);
            this.ProxyServerType = (ProxyServerType)GetValue(parameters, "ProxyServerType", (int)ovSettings.HttpProxyServerType);
        }