Builds a list of CacheNodes for Feeds and Implementations.
Inheritance: NanoByte.Common.Tasks.TaskBase
コード例 #1
0
            public override ExitCode Execute()
            {
                var nodeBuilder = new CacheNodeBuilder(Store, FeedCache);
                nodeBuilder.Run();

                if (AdditionalArgs.Count == 1)
                {
                    var uri = GetCanonicalUri(AdditionalArgs[0]);
                    if (uri.IsFile && !File.Exists(uri.LocalPath))
                        throw new FileNotFoundException(string.Format(Resources.FileOrDirNotFound, uri.LocalPath), uri.LocalPath);

                    var nodes = nodeBuilder.Nodes.OfType<OwnedImplementationNode>().Where(x => x.FeedUri == uri);
                    Handler.Output(Resources.CachedImplementations, nodes);
                }
                else
                {
                    var nodes = nodeBuilder.Nodes.OfType<ImplementationNode>();
                    Handler.Output(Resources.CachedImplementations, nodes);
                }

                return ExitCode.OK;
            }
コード例 #2
0
        private void refreshListWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            _store.Flush();
            _feedCache.Flush();

            var nodeBuilder = new CacheNodeBuilder(_store, _feedCache);
            nodeBuilder.Run();
            e.Result = nodeBuilder;
        }