예제 #1
0
        // 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));
                }
            }
        }
예제 #2
0
 static public object AIGetValue(AccountInfo ai, string name)
 {
     return(ai.GetValueForProperty(name));
 }