void IMdElementCtrl.Refresh()
        {
            if (m_MdElementEditor == null)
            {
                return;
            }

            if (m_MdElementEditor.GetEnabled(m_propname) == false)
            {
                this.Enabled = false;
                return;
            }

            m_httpBasicGPValue = m_MdElementEditor.GetValue(m_propname) as IHttpBasicGPValue;

            if (m_httpBasicGPValue == null)
            {
                return;
            }

            string authenticationString = m_httpBasicGPValue.EncodedUserNamePassWord;

            DecodeUserNamePassword(authenticationString);

            if (m_username != null)
            {
                txtUserName.Text = m_username;
            }

            if (m_password != null)
            {
                txtPassword.Text = m_password;
            }
        }
Ejemplo n.º 2
0
        public IGPMessage ValidateValue(IGPValue Value, IGPDomain Domain)
        {
            IGPMessage    validateValueMessage = new GPMessageClass();
            IGPUtilities3 gpUtilities          = new GPUtilitiesClass();

            IHttpBasicGPValue targetValue = gpUtilities.UnpackGPValue(Value) as IHttpBasicGPValue;

            if (targetValue == null)
            {
                IGPString targetValueString = gpUtilities.UnpackGPValue(Value) as IGPString;
                if (targetValueString != null)
                {
                    return(validateValueMessage);
                }
            }


            if (targetValue == null)
            {
                validateValueMessage.Type        = esriGPMessageType.esriGPMessageTypeError;
                validateValueMessage.ErrorCode   = 502;
                validateValueMessage.Description = resourceManager.GetString("GPTools_Authentication_HttpBasicDataType_valuevalidation");
            }

            if (Domain != null)
            {
                validateValueMessage = Domain.MemberOf((IGPValue)targetValue);
            }

            return(validateValueMessage);
        }
        void IMdElementCtrl.Uninitialize()
        {
            m_MdElementEditor  = null;
            m_httpBasicGPValue = null;
            m_propname         = null;
            m_dependencies     = null;
            m_password         = String.Empty;
            m_username         = String.Empty;

            Hide();
        }
Ejemplo n.º 4
0
        public void Assign(IClone src)
        {
            IHttpBasicGPValue httpBasicGPValue = src as IHttpBasicGPValue;

            if (httpBasicGPValue == null)
            {
                return;
            }

            DecodeUserNamePassword(httpBasicGPValue.EncodedUserNamePassWord);
        }
Ejemplo n.º 5
0
        public bool IsEqual(IClone other)
        {
            bool equalResult = false;

            IHttpBasicGPValue httpBasicGPValue = other as IHttpBasicGPValue;

            if (httpBasicGPValue == null)
            {
                return(equalResult);
            }

            equalResult = true;

            return(equalResult);
        }
Ejemplo n.º 6
0
        public bool IsEqual(IClone other)
        {
            bool equalResult = false;

            IHttpBasicGPValue httpBasicGPValue = other as IHttpBasicGPValue;

            if (httpBasicGPValue == null)
            {
                return(equalResult);
            }

            if (httpBasicGPValue.EncodedUserNamePassWord.Equals(EncodeUserAuthentication(m_username, m_password)))
            {
                equalResult = true;
            }

            return(equalResult);
        }
Ejemplo n.º 7
0
        void IMdElementCtrl.Uninitialize()
        {
            try
            {
                m_MdElementEditor  = null;
                m_httpBasicGPValue = null;
                m_propname         = null;
                m_dependencies     = null;
                m_password         = String.Empty;
                m_username         = String.Empty;

                Hide();
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
                System.Diagnostics.Debug.WriteLine(ex.StackTrace);
            }
        }
Ejemplo n.º 8
0
        void IMdElementCtrl.Refresh()
        {
            try
            {
                if (m_MdElementEditor == null)
                {
                    return;
                }

                if (m_MdElementEditor.GetEnabled(m_propname) == false)
                {
                    this.Enabled = false;
                    return;
                }

                m_httpBasicGPValue = m_MdElementEditor.GetValue(m_propname) as IHttpBasicGPValue;

                if (m_httpBasicGPValue == null)
                {
                    return;
                }

                string authenticationString = m_httpBasicGPValue.EncodedUserNamePassWord;

                DecodeUserNamePassword(authenticationString);

                if (m_username != null)
                {
                    txtUserName.Text = m_username;
                }

                if (m_password != null)
                {
                    txtPassword.Text = m_password;
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
                System.Diagnostics.Debug.WriteLine(ex.StackTrace);
            }
        }
        void IMdElementCtrl.Uninitialize()
        {
            try
            {
                m_MdElementEditor = null;
                m_httpBasicGPValue = null;
                m_propname = null;
                m_dependencies = null;
                m_password = String.Empty;
                m_username = String.Empty;

                Hide();
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
                System.Diagnostics.Debug.WriteLine(ex.StackTrace);
            }
        }
        void IMdElementCtrl.Refresh()
        {
            try
            {
                if (m_MdElementEditor == null)
                    return;

                if (m_MdElementEditor.GetEnabled(m_propname) == false)
                {
                    this.Enabled = false;
                    return;
                }

                m_httpBasicGPValue = m_MdElementEditor.GetValue(m_propname) as IHttpBasicGPValue;

                if (m_httpBasicGPValue == null)
                {
                    return;
                }

                string authenticationString = m_httpBasicGPValue.EncodedUserNamePassWord;

                DecodeUserNamePassword(authenticationString);

                if (m_username != null)
                {
                    txtUserName.Text = m_username;
                }

                if (m_password != null)
                {
                    txtPassword.Text = m_password;
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
                System.Diagnostics.Debug.WriteLine(ex.StackTrace);
            }
        }
        void IMdElementCtrl.Uninitialize()
        {
            m_MdElementEditor = null;
            m_httpBasicGPValue = null;
            m_propname = null;
            m_dependencies = null;
            m_password = String.Empty;
            m_username = String.Empty;

            Hide();
        }
        void IMdElementCtrl.Refresh()
        {
            if (m_MdElementEditor == null)
                return;

            if (m_MdElementEditor.GetEnabled(m_propname) == false)
            {
                this.Enabled = false;
                return;
            }

            m_httpBasicGPValue = m_MdElementEditor.GetValue(m_propname) as IHttpBasicGPValue;

            if (m_httpBasicGPValue == null)
            {
                return;
            }

            string authenticationString = m_httpBasicGPValue.EncodedUserNamePassWord;

            DecodeUserNamePassword(authenticationString);

            if (m_username != null)
            {
                txtUserName.Text = m_username;
            }

            if (m_password != null)
            {
                txtPassword.Text = m_password;
            }
        }