コード例 #1
0
        public async Task DeletePerson(Guid personId)
        {
            await faceClient.DeletePersonAsync(Constants.PERSON_GROUP_ID, personId);

            await faceClient.TrainPersonGroupAsync(Constants.PERSON_GROUP_ID);

            await WaitForTrainedPersonGroup(Constants.PERSON_GROUP_ID);
        }
コード例 #2
0
        public PersonViewModel(Person person, IFaceServiceClient client, string group, IDialogService dialogService)
        {
            Person        = person;
            DeleteCommand = ReactiveCommand.CreateFromTask(async() =>
            {
                await client.DeletePersonAsync(@group, person.PersonId);
                await client.TrainPersonGroupAsync(DefaultValues.DefaultGroupName);
                MessageBus.Current.SendMessage(new PersonDeletedMessage(person));
            });

            DeleteCommand.HandleErrors(dialogService);
        }
コード例 #3
0
        /// <summary>
        /// Delete a person from the person group
        /// </summary>
        /// <param name="personToDelete">The name of the person to delete</param>
        public async void deletePerson(string personToDelete)
        {
            var vec = await faceServiceClient.GetPersonsAsync(szPersonGroupID);

            foreach (var id in vec)
            {
                String name = id.Name;
                if (name.Equals(personToDelete))
                {
                    await faceServiceClient.DeletePersonAsync(szPersonGroupID, id.PersonId);

                    train();
                }
            }
        }
コード例 #4
0
        /// <summary>
        /// Asynchronously removes a person from api database.
        /// this method is call when an error occured during creation of person or
        /// during the creation of its first picture
        /// </summary>
        public async Task PersonCreationFallBack(Guid?personApiId)
        {
            if (personApiId == null)
            {
                return;
            }

            try
            {
                await _faceServiceClient.DeletePersonAsync(Global.OxfordPersonGroupId, personApiId.Value);

                Directory.Delete(MapPath($"{Global.PersonsDatabaseDirectory}/{personApiId}"), true);
            }
            catch (Exception e)
            {
                LogManager.GetLogger(GetType()).Info("Error occured during fallback of creation of a new person", e);
            }
        }
コード例 #5
0
        private async Task RemovePerson(Guid personId)
        {
            await _faceApiClient.DeletePersonAsync(WhitelistId, personId);

            _whitelist.RemovePerson(personId);
        }
コード例 #6
0
 public async Task DeletePerson(string customGroupId, Guid personId)
 {
     await _faceServiceClient.DeletePersonAsync(customGroupId, personId);
 }
コード例 #7
0
 public Task DeletePersonAsync(string personGroupId, Guid personId)
 {
     return(innerClient.DeletePersonAsync(personGroupId, personId));
 }
コード例 #8
0
 /// <summary>
 ///     사람 삭제
 /// </summary>
 /// <param name="personId"></param>
 /// <returns></returns>
 public async Task DeletePersonAsync(Guid personId)
 {
     await faceServiceClient.DeletePersonAsync(_personGroupId, personId);
 }