Example #1
0
        /// <inheritdoc />
        public void Execute(IFileSource fileSource)
        {
            Log.InfoFormat("Executing pipeline with {0} {1}", fileSource?.GetType().Name, fileSource);

            IFileSource prev = null;

            DataProcessors.Aggregate(fileSource, (current, processor) =>
            {
                if (current != prev)
                {
                    current?.Init();
                    prev = current;
                }

                current?.BeginExecute();

                var newSource = processor.Execute(current);

                current?.EndExecute();

                return(newSource);
            });

            Log.InfoFormat("Executed pipeline with {0} {1}", fileSource?.GetType().Name, fileSource);
        }
Example #2
0
        private void Subscribe(string id, long timestamp, IFileSource file_source)
        {
            string text   = file_source.Read("mod.yaml");
            Header header = (!string.IsNullOrEmpty(text)) ? YamlIO.Parse <Header>(text, file_source.GetRoot() + "\\mod.yaml", null, null) : null;

            if (header == null)
            {
                Header header2 = new Header();
                header2.title       = id;
                header2.description = id;
                header = header2;
            }
            Label label = default(Label);

            label.id = id;
            label.distribution_platform = distribution_platform;
            label.version = id.GetHashCode();
            label.title   = header.title;
            Label label2 = label;
            Mod   mod    = new Mod(label2, header.description, file_source, UI.FRONTEND.MODS.TOOLTIPS.MANAGE_LOCAL_MOD, delegate
            {
                Application.OpenURL("file://" + file_source.GetRoot());
            });

            if (file_source.GetType() == typeof(Directory))
            {
                mod.status = Mod.Status.Installed;
            }
            Global.Instance.modManager.Subscribe(mod, this);
        }
Example #3
0
        /// <inheritdoc />
        public void Execute(IFileSource fileSource)
        {
            Log.Info($"Executing pipeline with filesource {fileSource.GetType().Name}");
            IFileSource prev = null;

            DataProcessors.Aggregate(fileSource, (current, processor) =>
            {
                if (current != prev)
                {
                    current.Init();
                    prev = current;
                }

                current.BeginExecute();

                var newSource = processor.Execute(current);

                current.EndExecute();

                return(newSource);
            });
        }