示例#1
0
        //
        // Getting changes to persist (or to build a query from a QBE filter)
        //

        // Given a property name, returns true if that property has changed since it was loaded, false otherwise.
        internal override bool GetChangeStatusForProperty(string propertyName)
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info, "AuthenticablePrincipal", "GetChangeStatusForProperty: name=" + propertyName);

            switch (propertyName)
            {
            case PropertyNames.AuthenticablePrincipalCertificates:
                return(HasCertificateCollectionChanged());

            case PropertyNames.AuthenticablePrincipalEnabled:
                return(_enabledChanged == LoadState.Changed);

            default:

                // Check if the property is supported by AdvancedFilter class.
                // If writeable properties are added to the rosf class then we will need
                // to add some type of tag to the property names to differentiate them here
                bool?val = rosf.GetChangeStatusForProperty(propertyName);

                if (val.HasValue == true)
                {
                    return(val.Value);
                }

                if (propertyName.StartsWith(PropertyNames.AcctInfoPrefix, StringComparison.Ordinal))
                {
                    if (_accountInfo == null)
                    {
                        return(false);
                    }

                    return(_accountInfo.GetChangeStatusForProperty(propertyName));
                }
                else if (propertyName.StartsWith(PropertyNames.PwdInfoPrefix, StringComparison.Ordinal))
                {
                    if (_passwordInfo == null)
                    {
                        return(false);
                    }

                    return(_passwordInfo.GetChangeStatusForProperty(propertyName));
                }
                else
                {
                    return(base.GetChangeStatusForProperty(propertyName));
                }
            }
        }
示例#2
0
 static public bool AIGetChangeStatus(AccountInfo ai, string name)
 {
     return(ai.GetChangeStatusForProperty(name));
 }