Esempio n. 1
0
        //--------------------//

        #region Build tree list
        /// <summary>
        /// Fills the <see cref="_treeView"/> with entries.
        /// </summary>
        internal async Task RefreshListAsync()
        {
            buttonRefresh.Enabled = false;
            labelLoading.Visible  = true;

            _store.Flush();

            try
            {
                var nodeBuilder = await Task.Run(() =>
                {
                    var builder = new CacheNodeBuilder(_store, _feedCache);
                    builder.Run();
                    return(builder);
                });

                var nodes = nodeBuilder.Nodes !.Select(x => new StoreManageNode(x, this));
                _treeView.Nodes    = new NamedCollection <StoreManageNode>(nodes);
                textTotalSize.Text = nodeBuilder.TotalSize.FormatBytes(CultureInfo.CurrentCulture);

                OnCheckedEntriesChanged(null, EventArgs.Empty);
            }
            catch (Exception ex)
            {
                Msg.Inform(this, ex.Message, MsgSeverity.Error);
            }

            labelLoading.Visible  = false;
            buttonRefresh.Enabled = true;
        }
        private void refreshListWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            _store.Flush();

            var nodeBuilder = new CacheNodeBuilder(_store, _feedCache);

            nodeBuilder.Run();
            e.Result = nodeBuilder;
        }
Esempio n. 3
0
        /// <summary>
        /// Determines the local path of an implementation.
        /// </summary>
        /// <param name="implementation">The implementation to be located.</param>
        /// <returns>A fully qualified path to the directory containing the implementation; <c>null</c> if the requested implementation could not be found in the store or is a package implementation.</returns>
        protected string?GetPathSafe(ImplementationBase implementation)
        {
            #region Sanity checks
            if (implementation == null)
            {
                throw new ArgumentNullException(nameof(implementation));
            }
            #endregion

            if (implementation.ID.StartsWith(ExternalImplementation.PackagePrefix))
            {
                return(null);
            }

            _implementationStore.Flush();
            return(_implementationStore.GetPath(implementation.ManifestDigest));
        }