예제 #1
0
        /// <summary>
        /// Removes the given service from the given project
        /// </summary>
        public static async Task RemoveServiceFromProject(DotNetProject project, string serviceId)
        {
            var binding = project.GetConnectedServicesBinding();
            var service = binding.SupportedServices.FirstOrDefault(x => x.Id == serviceId);

            if (service != null)
            {
                if (!(await ConfirmServiceRemoval(service).ConfigureAwait(false)))
                {
                    return;
                }

                await Runtime.RunInMainThread(() => EnsureServiceDetailTabIsClosed (project, serviceId));

                await service.RemoveFromProject();
            }
        }