private void UpdateReverseDependencies(IEnumerable <IPackageVersion> reverseDependencies)
        {
            reverseDependenciesNames.Clear();
            reverseDependenciesVersions.Clear();
            reverseDependenciesListLowWidth.Clear();

            var hasReverseDependencies = reverseDependencies?.Any() ?? false;

            UIUtils.SetElementDisplay(noReverseDependencies, !hasReverseDependencies);
            UIUtils.SetElementDisplay(reverseDependenciesNames, hasReverseDependencies);
            UIUtils.SetElementDisplay(reverseDependenciesVersions, hasReverseDependencies);

            if (!hasReverseDependencies)
            {
                return;
            }

            foreach (var version in reverseDependencies)
            {
                var nameText    = version.displayName ?? string.Empty;
                var versionText = GetVersionText(version);

                reverseDependenciesNames.Add(BuildSelectableLabel(nameText, "text"));
                reverseDependenciesVersions.Add(BuildSelectableLabel(versionText, "text"));

                var reverseDependencyLowWidthItem = new PackageDependencySampleItemLowWidth(m_ResourceLoader, nameText, versionText, null);
                reverseDependenciesListLowWidth.Add(reverseDependencyLowWidthItem);
            }
        }
        private void UpdateDependencies(DependencyInfo[] dependencies)
        {
            dependenciesNames.Clear();
            dependenciesVersions.Clear();
            dependenciesStatuses.Clear();
            dependenciesListLowWidth.Clear();

            var hasDependencies = dependencies?.Any() ?? false;

            UIUtils.SetElementDisplay(noDependencies, !hasDependencies);
            UIUtils.SetElementDisplay(dependenciesNames, hasDependencies);
            UIUtils.SetElementDisplay(dependenciesVersions, hasDependencies);

            if (!hasDependencies)
            {
                return;
            }

            foreach (var dependency in dependencies)
            {
                m_PackageDatabase.GetPackageAndVersion(dependency, out var package, out var version);

                var nameText    = GetNameText(dependency, package, version);
                var versionText = GetVersionText(dependency, package);
                var statusText  = GetStatusText(dependency, package?.versions.installed);

                dependenciesNames.Add(BuildSelectableLabel(nameText, "text"));
                dependenciesVersions.Add(BuildSelectableLabel(versionText, "text"));
                dependenciesStatuses.Add(BuildLabel(statusText, "text"));

                var dependencyLowWidthItem = new PackageDependencySampleItemLowWidth(m_ResourceLoader, nameText, versionText, BuildLabel(statusText, "text"));
                dependenciesListLowWidth.Add(dependencyLowWidthItem);
            }
        }
예제 #3
0
        private void SwitchToSampleListLowWidth()
        {
            UIUtils.SetElementDisplay(samplesListLowWidth, true);
            UIUtils.SetElementDisplay(samplesContainer, false);

            samplesListLowWidth.Clear();

            foreach (var sample in m_Samples)
            {
                var sampleVisualItemLowWidth = new PackageDependencySampleItemLowWidth(m_ResourceLoader, m_Version, sample, m_Selection, m_AssetDatabase, m_Application, m_IOProxy);
                samplesListLowWidth.Add(sampleVisualItemLowWidth);
            }
        }
예제 #4
0
        private void SwitchToSampleListLowWidth()
        {
            UIUtils.SetElementDisplay(samplesListLowWidth, true);
            UIUtils.SetElementDisplay(samplesContainer, false);

            samplesListLowWidth.Clear();

            foreach (var sample in m_Samples)
            {
                var sampleVisualItemLowWidth = new PackageDependencySampleItemLowWidth(m_Version, sample);
                samplesListLowWidth.Add(sampleVisualItemLowWidth);
            }
        }