Example #1
0
 private PipelineInstance(ProjectDOM.Pipeline pipeline, INSTANCEFACTORY filterResolver, SETTINGSFUNCTION settingsResolver)
 {
     _InstanceFactory     = filterResolver;
     _SettingsFactory     = settingsResolver;
     _Pipeline            = pipeline;
     _PipelineFingerPrint = pipeline.GetHierarchyFingerPrint();
 }
Example #2
0
        private void _SetupIsReady()
        {
            if (_BuildSettings == null)
            {
                throw new InvalidOperationException($"Call {nameof(Setup)} first");
            }

            bool allInstancesReady = !_NodeInstances.Values
                                     .OfType <_UnknownNode>()
                                     .Any();

            if (!allInstancesReady)
            {
                var filtersNotFound = _NodeInstances.Values
                                      .OfType <_UnknownNode>()
                                      .Select(item => item.ClassId)
                                      .Join(", ");

                throw new InvalidOperationException($"{filtersNotFound} filters couldn't be instantiated.");
            }

            if (_PipelineFingerPrint != _Pipeline.GetHierarchyFingerPrint())
            {
                throw new InvalidOperationException("DOM hierarchy has changed, call Setup again");
            }
        }