Ejemplo n.º 1
0
 public void SetResults(Guid key, Object result, TimeSpan exeTime, PipelineFileManager results)
 {
     if (this.TryGetValue(key, out PipelineClientState state))
     {
         state.Update(result, exeTime, results);
     }
 }
Ejemplo n.º 2
0
        public void Update(Object result, TimeSpan exeTime, PipelineFileManager results)
        {
            lock (_Mutex)
            {
                _LastResult        = result;
                _LastExecutionTime = exeTime;
            }

            _RaiseChanged(nameof(LastResult), nameof(LastTime));
        }
Ejemplo n.º 3
0
        private PipelineEvaluator
        (
            PipelineFileManager fileManager,
            Guid rootId,
            Guid[] nodeIds,
            Func <Guid, SDK.ContentObject> instanceFunc,
            Func <Type, SDK.ContentObject> settingsFunc,
            Func <Guid, IPropertyProvider> propertyFunc,
            SDK.IMonitorContext monitor
        )
        {
            _FileManager = fileManager;

            _NodeOrder      = nodeIds;
            _RootIdentifier = rootId;
            _InstanceFunc   = instanceFunc;
            _SettingsFunc   = settingsFunc;
            _PropertiesFunc = propertyFunc;

            _Monitor = monitor;

            _AcquireInstances();
        }
Ejemplo n.º 4
0
 internal EvaluationResult(PipelineFileManager files)
 {
     _Files = files;
 }
Ejemplo n.º 5
0
        public static PipelineEvaluator Create
        (
            BuildContext buildSettings,
            Guid rootId,
            Guid[] nodeIds,
            Func <Guid, SDK.ContentObject> instanceFunc,
            Func <Type, SDK.ContentObject> settingsFunc,
            Func <Guid, IPropertyProvider> propertiesFunc,
            SDK.IMonitorContext monitor = null
        )
        {
            if (buildSettings == null)
            {
                throw new ArgumentNullException(nameof(buildSettings));
            }

            if (!buildSettings.CanBuild)
            {
                throw new ArgumentException(buildSettings.CurrentError, nameof(buildSettings));
            }

            if (nodeIds == null)
            {
                throw new ArgumentNullException(nameof(nodeIds));
            }
            if (!nodeIds.Contains(rootId))
            {
                throw new ArgumentNullException(nameof(rootId));
            }

            if (instanceFunc == null)
            {
                throw new ArgumentNullException(nameof(instanceFunc));
            }
            if (settingsFunc == null)
            {
                throw new ArgumentNullException(nameof(settingsFunc));
            }
            if (propertiesFunc == null)
            {
                throw new ArgumentNullException(nameof(propertiesFunc));
            }

            foreach (var id in nodeIds)
            {
                if (id == Guid.Empty)
                {
                    throw new ArgumentException("Empty Guid found in collection", nameof(nodeIds));
                }

                var instance = instanceFunc(id);
                if (instance == null || instance is _UnknownNode)
                {
                    throw new KeyNotFoundException($"Instance {id} not found");
                }

                var properties = propertiesFunc(id);
                if (properties == null)
                {
                    throw new KeyNotFoundException($"Properties {id} not found");
                }
            }

            var fileManager = PipelineFileManager.Create(buildSettings.SourceDirectory, buildSettings.TargetDirectory, buildSettings.IsSimulation);

            return(new PipelineEvaluator(fileManager, rootId, nodeIds, instanceFunc, settingsFunc, propertiesFunc, monitor));
        }