예제 #1
0
        internal async Task RemoveTagAsync(RemoteRepositoryTag tag, IProgress <OperationProgress> progress, CancellationToken cancellationToken)
        {
            Verify.Argument.IsNotNull(tag, nameof(tag));
            Verify.Argument.IsFalse(tag.IsDeleted, nameof(tag),
                                    Resources.ExcSuppliedObjectIsDeleted.UseAsFormat("tag"));

            var parameters = GetRemoveRemoteReferenceParameters(tag);
            await Remote.Repository.Accessor
            .RemoveRemoteReferences.InvokeAsync(parameters, progress, cancellationToken);

            _remoteTags.Remove(tag.Name);
            tag.MarkAsDeleted();
            InvokeTagDeleted(tag);

            //return Remote.Repository.Accessor
            //	.RemoveRemoteReferences.InvokeAsync(parameters, progress, cancellationToken)
            //	.ContinueWith(
            //	t =>
            //	{
            //		TaskUtility.PropagateFaultedStates(t);
            //		_remoteTags.Remove(tag.Name);
            //		tag.MarkAsDeleted();
            //		InvokeTagDeleted(tag);
            //	},
            //	cancellationToken,
            //	TaskContinuationOptions.ExecuteSynchronously,
            //	TaskScheduler.Default);
        }
예제 #2
0
        internal void RemoveTag(RemoteRepositoryTag tag)
        {
            Verify.Argument.IsNotNull(tag, nameof(tag));
            Verify.Argument.IsFalse(tag.IsDeleted, nameof(tag),
                                    Resources.ExcSuppliedObjectIsDeleted.UseAsFormat("tag"));

            var parameters = GetRemoveRemoteReferenceParameters(tag);

            Remote.Repository.Accessor.RemoveRemoteReferences.Invoke(parameters);

            _remoteTags.Remove(tag.Name);
            tag.MarkAsDeleted();
            InvokeTagDeleted(tag);
        }