コード例 #1
0
 private void StartSpinner()
 {
     UIUtils.SetElementDisplay(SpinnerContainer, true);
     Spinner.Start();
     StateLabel.AddToClassList("no-icon");
     UIUtils.SetElementDisplay(StateLabel, false);
 }
コード例 #2
0
        private void OnPackageChanged()
        {
            var displayPackage = Display(package);

            if (displayPackage == null)
            {
                return;
            }

            NameLabel.text    = displayPackage.DisplayName;
            VersionLabel.text = displayPackage.Version.ToString();

            var stateClass = GetIconStateId(package.Current ?? package.Latest);

            StateLabel.RemoveFromClassList(currentStateClass);
            StateLabel.AddToClassList(stateClass);

            if (package.Current == null && PackageCollection.Instance.Filter == PackageFilter.All)
            {
                PackageContainer.AddToClassList("not-installed");
            }
            else
            {
                PackageContainer.RemoveFromClassList("not-installed");
            }

            UIUtils.SetElementDisplay(VersionLabel, !PackageInfo.IsModule(package.Name));

            currentStateClass = stateClass;
            if (displayPackage.State != PackageState.InProgress && Spinner.Started)
            {
                Spinner.Stop();
            }
        }
コード例 #3
0
        private void OnPackageChanged()
        {
            var displayPackage = package != null ? package.VersionToDisplay : null;

            if (displayPackage == null)
            {
                return;
            }

            Expander.Expanded = Selection.IsExpanded(package.VersionToDisplay);

            SetDisplayName(displayPackage.DisplayName);
            VersionLabel.text = displayPackage.StandardizedLabel(false);

            var stateClass = GetIconStateId(displayPackage);

            if (displayPackage.State == PackageState.Outdated && package.LatestUpdate == package.Current)
            {
                stateClass = GetIconStateId(PackageState.UpToDate);
            }
            if (displayPackage.IsInDevelopment)
            {
                stateClass = "development";
            }
            // Error state should be last as it should supercede other states
            if (package.Error != null)
            {
                stateClass = GetIconStateId(PackageState.Error);
            }
            if (stateClass == GetIconStateId(PackageState.UpToDate) && package.Current != null)
            {
                stateClass = "installed";
            }

            StateLabel.RemoveFromClassList(currentStateClass);
            StateLabel.AddToClassList(stateClass);

            UIUtils.SetElementDisplay(Expander, !displayPackage.IsBuiltIn);
            UIUtils.SetElementDisplay(ExpanderHidden, displayPackage.IsBuiltIn);
            UIUtils.SetElementDisplay(VersionList, !displayPackage.IsBuiltIn);
            UIUtils.SetElementDisplay(VersionLabel, !displayPackage.IsBuiltIn);

            RefreshVersions();

            currentStateClass = stateClass;
            if (displayPackage.State != PackageState.InProgress && Spinner.Started)
            {
                StopSpinner();
            }
        }
コード例 #4
0
        private void OnPackageChanged()
        {
            var displayPackage = package != null ? package.VersionToDisplay : null;

            if (displayPackage == null)
            {
                return;
            }

            NameLabel.text    = displayPackage.DisplayName;
            VersionLabel.text = displayPackage.Version.ToString();

            var stateClass = GetIconStateId(displayPackage);

            if (displayPackage.State == PackageState.Outdated && package.LatestUpdate == package.Current)
            {
                stateClass = GetIconStateId(PackageState.UpToDate);
            }
            if (PackageCollection.Instance.GetPackageError(package) != null)
            {
                stateClass = GetIconStateId(PackageState.Error);
            }
            if (stateClass == GetIconStateId(PackageState.UpToDate) && package.Current != null)
            {
                stateClass = "installed";
            }

            StateLabel.RemoveFromClassList(currentStateClass);
            StateLabel.AddToClassList(stateClass);

            UIUtils.SetElementDisplay(VersionLabel, !displayPackage.IsBuiltIn);

            currentStateClass = stateClass;
            if (displayPackage.State != PackageState.InProgress && Spinner.Started)
            {
                StopSpinner();
            }
        }
コード例 #5
0
 private void StartSpinner()
 {
     Spinner.Start();
     StateLabel.AddToClassList("no-icon");
 }