// Given a property name, returns the current value for the property. internal override object GetValueForProperty(string propertyName) { GlobalDebug.WriteLineIf(GlobalDebug.Info, "AuthenticablePrincipal", "GetValueForProperty: name=" + propertyName); switch (propertyName) { case PropertyNames.AuthenticablePrincipalCertificates: return(_certificates); case PropertyNames.AuthenticablePrincipalEnabled: return(_enabled); default: object val = rosf.GetValueForProperty(propertyName); if (null != val) { return(val); } if (propertyName.StartsWith(PropertyNames.AcctInfoPrefix, StringComparison.Ordinal)) { if (_accountInfo == null) { // Should never happen, since GetChangeStatusForProperty returned false Debug.Fail("AuthenticablePrincipal.GetValueForProperty(AcctInfo): shouldn't be here"); throw new InvalidOperationException(); } return(_accountInfo.GetValueForProperty(propertyName)); } else if (propertyName.StartsWith(PropertyNames.PwdInfoPrefix, StringComparison.Ordinal)) { if (_passwordInfo == null) { // Should never happen, since GetChangeStatusForProperty returned false Debug.Fail("AuthenticablePrincipal.GetValueForProperty(PwdInfo): shouldn't be here"); throw new InvalidOperationException(); } return(_passwordInfo.GetValueForProperty(propertyName)); } else { return(base.GetValueForProperty(propertyName)); } } }
static public object PIGetValue(PasswordInfo pi, string name) { return(pi.GetValueForProperty(name)); }