IEnumerator InitializeAsync()
        {
            Assert.That(!_isInitialized);
            _projectHandler.RefreshProject();

            yield return(_packageHandler.RefreshPackagesAsync());

            yield return(_releasesHandler.RefreshReleasesAsync());

            _isInitialized = true;
        }
Example #2
0
        IEnumerator TryChangeProjectType(ProjectConfigTypes configType)
        {
            if (_projectHandler.HasProjectConfigChanged())
            {
                var fileName = Path.GetFileName(ProjenyEditorUtil.GetProjectConfigPath(_view.ProjectConfigType));
                var choice   = _view.PromptForUserChoice(
                    "Do you want to save changes to {0}?".Fmt(fileName), new[] { "Save", "Don't Save", "Cancel" }, null, null, 0, 2);

                yield return(choice);

                switch (choice.Current)
                {
                case 0:
                {
                    _projectHandler.OverwriteConfig();
                    break;
                }

                case 1:
                {
                    // Do nothing
                    break;
                }

                case 2:
                {
                    yield break;
                }

                default:
                {
                    Assert.Throw();
                    break;
                }
                }
            }

            _view.ProjectConfigType = configType;
            _projectHandler.RefreshProject();
        }
Example #3
0
        IEnumerator InitializeAsync(bool isFirstLoad)
        {
            Assert.That(!_isInitialized);

            if (isFirstLoad)
            {
                _projectHandler.RefreshProject();

                yield return(_packageHandler.RefreshPackagesAsync());

                yield return(_releasesHandler.RefreshReleasesAsync());
            }

            _isInitialized = true;
        }