Пример #1
0
        /// <summary>
        /// Gets or creates the UI state for a repository.
        /// </summary>
        /// <param name="repositoryUrl">The URL of the repository.</param>
        /// <returns>A <see cref="RepositoryUIState"/> object.</returns>
        public RepositoryUIState GetOrCreateRepositoryState(string repositoryUrl)
        {
            var result = RepositoryState.FirstOrDefault(x => x.RepositoryUrl == repositoryUrl);

            if (result == null)
            {
                result = new RepositoryUIState { RepositoryUrl = repositoryUrl };
                RepositoryState.Add(result);
            }

            return result;
        }
Пример #2
0
        /// <summary>
        /// Gets or creates the UI state for a repository.
        /// </summary>
        /// <param name="repositoryUrl">The URL of the repository.</param>
        /// <returns>A <see cref="RepositoryUIState"/> object.</returns>
        public RepositoryUIState GetOrCreateRepositoryState(string repositoryUrl)
        {
            var result = RepositoryState.FirstOrDefault(x => x.RepositoryUrl == repositoryUrl);

            if (result == null)
            {
                result = new RepositoryUIState {
                    RepositoryUrl = repositoryUrl
                };
                RepositoryState.Add(result);
            }

            return(result);
        }