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 }
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); }