Beispiel #1
0
        public virtual IdentityStoreObject CloneObjectForUpdate(List <string> attributeNamesToClone, IdentityStoreObject objectToClone, IdentityStoreObject objectOrignal)
        {
            IdentityStoreObject identityStoreObject = new IdentityStoreObject();

            identityStoreObject.set_ObjectIdFromIdentityStore(objectToClone.get_ObjectIdFromIdentityStore());
            identityStoreObject.set_ObjectName(objectToClone.get_ObjectName());
            identityStoreObject.set_ObjectDisplayName(objectToClone.get_ObjectDisplayName());
            identityStoreObject.set_ObjectType(objectToClone.get_ObjectType());
            identityStoreObject.set_AttributesBusinessObject(new AttributeCollection());
            IdentityStoreObject newObject = identityStoreObject;

            foreach (string attributeName in attributeNamesToClone)
            {
                List <Imanami.GroupID.DataTransferObjects.DataContracts.Services.Attribute> values = this.GetAttributeValues(attributeName, objectToClone.get_AttributesBusinessObject());
                if ((values == null ? false : values.Any <Imanami.GroupID.DataTransferObjects.DataContracts.Services.Attribute>()))
                {
                    if (objectOrignal != null)
                    {
                        List <Imanami.GroupID.DataTransferObjects.DataContracts.Services.Attribute> origValues = this.GetAttributeValues(attributeName, objectOrignal.get_AttributesBusinessObject());
                        if ((origValues == null || origValues.Count != 1 ? false : StringUtility.EqualsIgnoreCase(origValues[0].get_Value(), values[0].get_Value())))
                        {
                            continue;
                        }
                    }
                    newObject.get_AttributesBusinessObject().Add(attributeName, values);
                }
            }
            return(newObject);
        }
Beispiel #2
0
        private Group ConvertToGroup(IdentityStoreObject identityStoreObject)
        {
            Group group1;

            if (!(identityStoreObject is Group))
            {
                Group group = new Group();
                group.set_ObjectIdFromIdentityStore(identityStoreObject.get_ObjectIdFromIdentityStore());
                group.set_ObjectName(identityStoreObject.get_ObjectName());
                group.set_ObjectDisplayName(identityStoreObject.get_ObjectDisplayName());
                group.set_DisplayName(identityStoreObject.get_ObjectDisplayName());
                group.set_ObjectType(identityStoreObject.get_ObjectType());
                group.set_AttributesBusinessObject(identityStoreObject.get_AttributesBusinessObject());
                group.set_StopNotification(identityStoreObject.get_StopNotification());
                group1 = group;
            }
            else
            {
                group1 = identityStoreObject as Group;
            }
            return(group1);
        }