public async Task Load(Repository repo)
        {
            if (!GlobalHelper.IsInternet())
            {
                //Sending NoInternet message to all viewModels
                Messenger.Default.Send(new GlobalHelper.LocalNotificationMessageType {
                    Message = "No Internet", Glyph = "\uE704"
                });
            }
            else
            {
                isLoading = true;
                if (repo != Repository)
                {
                    Repository = repo;

                    if (string.IsNullOrWhiteSpace(Repository.DefaultBranch))
                    {
                        SelectedBranch = await RepositoryUtility.GetDefaultBranch(Repository.Id);
                    }
                    else
                    {
                        SelectedBranch = Repository.DefaultBranch;
                    }

                    Branches = await RepositoryUtility.GetAllBranches(Repository);

                    Content = await RepositoryUtility.GetRepositoryContent(Repository, SelectedBranch);
                }
                isLoading = false;
            }
        }
Esempio n. 2
0
        public async Task Load(Repository repo)
        {
            if (GlobalHelper.IsInternet())
            {
                isLoading = true;
                if (repo != Repository)
                {
                    Repository = repo;

                    if (string.IsNullOrWhiteSpace(Repository.DefaultBranch))
                    {
                        SelectedBranch = await RepositoryUtility.GetDefaultBranch(Repository.Id);
                    }
                    else
                    {
                        SelectedBranch = Repository.DefaultBranch;
                    }

                    Branches = await RepositoryUtility.GetAllBranches(Repository);

                    Content = await RepositoryUtility.GetRepositoryContent(Repository, SelectedBranch);
                }
                isLoading = false;
            }
        }
        public async Task Load(Repository repo)
        {
            if (!GlobalHelper.IsInternet())
            {
                //Sending NoInternet message to all viewModels
                Messenger.Default.Send(new GlobalHelper.NoInternetMessageType());
            }
            else
            {
                isLoading = true;
                if (repo != Repository)
                {
                    Repository = repo;

                    if (string.IsNullOrWhiteSpace(Repository.DefaultBranch))
                    {
                        SelectedBranch = await RepositoryUtility.GetDefaultBranch(Repository.Id);
                    }
                    else
                    {
                        SelectedBranch = Repository.DefaultBranch;
                    }

                    Branches = await RepositoryUtility.GetAllBranches(Repository);

                    Content = await RepositoryUtility.GetRepositoryContent(Repository, SelectedBranch);
                }
                isLoading = false;

                //Sending Internet available message to all viewModels
                Messenger.Default.Send(new GlobalHelper.HasInternetMessageType());
            }
        }