Esempio n. 1
0
        private void SetPassword(ProtectedString ps)
        {
            if (ps == null)
            {
                Debug.Assert(false); return;
            }

            PwInputControlGroup icg = (m_oTarget as PwInputControlGroup);

            if (icg != null)
            {
                icg.SetPassword(ps, true);
                return;
            }

            TextBoxBase tb = (m_oTarget as TextBoxBase);

            if (tb != null)
            {
                tb.Text = ps.ReadString();
                return;
            }

            Debug.Assert(false);             // Unknown target type
        }
Esempio n. 2
0
        private ProtectedString GetPassword()
        {
            PwInputControlGroup icg = (m_oTarget as PwInputControlGroup);

            if (icg != null)
            {
                return(icg.GetPasswordEx());
            }

            TextBoxBase tb = (m_oTarget as TextBoxBase);

            if (tb != null)
            {
                return(new ProtectedString(false, tb.Text));
            }

            Debug.Assert(false);             // Unknown target type
            return(null);
        }