private static bool CallAssignCollaboratorRole(string targetObjectID, IContainerOwner owner, InformationSource groupContainerSource, NameValueCollection formSubmitContent) { if(groupContainerSource == null) throw new ArgumentNullException("groupContainerSource"); GroupContainer groupContainer = (GroupContainer) groupContainerSource.RetrieveInformationObject(); string roleToAssign = formSubmitContent["AssignRoleToCollaborator"]; string groupID = owner.LocationPrefix; string collaboratorID = targetObjectID; AssignCollaboratorRole.Execute(new AssignCollaboratorRoleParameters { CollaboratorID = collaboratorID, GroupContainer = groupContainer, GroupID = groupID, RoleToAssign = roleToAssign }); return true; }
private static bool CallUnlinkEmailAddress(string targetObjectID, IContainerOwner owner, InformationSource accountContainerSource) { if(accountContainerSource == null) throw new ArgumentNullException("accountContainerSource"); AccountContainer accountContainer = (AccountContainer) accountContainerSource.RetrieveInformationObject(); string accountID = owner.LocationPrefix; string emailID = targetObjectID; UnlinkEmailAddress.Execute(new UnlinkEmailAddressParameters { AccountContainerBeforeGroupRemoval = accountContainer, AccountID = accountID, EmailAddressID = emailID }); return true; }
private static bool CallRemoveImageFromImageGroup(string targetObjectId, IContainerOwner owner, InformationSource imageGroupSource) { ImageGroup imageGroup = (ImageGroup) imageGroupSource.RetrieveInformationObject(); var imageToDelete = imageGroup.ImagesCollection.CollectionContent.FirstOrDefault(img => img.ID == targetObjectId); imageGroup.ImagesCollection.CollectionContent.Remove(imageToDelete); imageToDelete.DeleteInformationObject(); imageGroup.StoreInformation(); return true; }