Exemplo n.º 1
0
        private async Task InitializeServicesAsync()
        {
            if (this.apiClient == null)
            {
                this.apiClient = ApiClientProvider.GetClient();
            }

            if (this.typeContainer == null)
            {
                this.typeContainer = new ContributionTypeContainer(this.apiClient);
            }

            if (this.areaContainer == null)
            {
                this.areaContainer = new ContributionAreaContainer(this.apiClient);
            }

            if (contributionSubmissionService == null)
            {
                contributionSubmissionService = new ContributionSubmissionService(this.apiClient);
            }

            if (this.containerManager == null)
            {
                this.containerManager = new DataContainerManager(
                    this.typeContainer,
                    this.areaContainer);
            }

            try
            {
                await this.containerManager.LoadAsync();
            }
            catch (Exception ex)
            {
#if DEBUG
                System.Diagnostics.Debug.WriteLine(ex.ToString());
#endif
            }
        }