示例#1
0
        /// <summary>
        /// Constructor called by Evaluator.
        /// All parameters are in the unevaluated state.
        /// All location parameters may be null if not applicable, except for the main location parameter.
        /// </summary>
        internal ProjectTargetInstance
        (
            string name,
            string condition,
            string inputs,
            string outputs,
            string returns,
            string keepDuplicateOutputs,
            string dependsOnTargets,
            ElementLocation location,
            ElementLocation conditionLocation,
            ElementLocation inputsLocation,
            ElementLocation outputsLocation,
            ElementLocation returnsLocation,
            ElementLocation keepDuplicateOutputsLocation,
            ElementLocation dependsOnTargetsLocation,
            ElementLocation beforeTargetsLocation,
            ElementLocation afterTargetsLocation,
            ObjectModel.ReadOnlyCollection <ProjectTargetInstanceChild> children,
            ObjectModel.ReadOnlyCollection <ProjectOnErrorInstance> onErrorChildren,
            bool parentProjectSupportsReturnsAttribute
        )
        {
            ErrorUtilities.VerifyThrowInternalLength(name, "name");
            ErrorUtilities.VerifyThrowInternalNull(condition, "condition");
            ErrorUtilities.VerifyThrowInternalNull(inputs, "inputs");
            ErrorUtilities.VerifyThrowInternalNull(outputs, "outputs");
            ErrorUtilities.VerifyThrowInternalNull(keepDuplicateOutputs, "keepDuplicateOutputs");
            ErrorUtilities.VerifyThrowInternalNull(dependsOnTargets, "dependsOnTargets");
            ErrorUtilities.VerifyThrowInternalNull(location, "location");
            ErrorUtilities.VerifyThrowInternalNull(children, "children");
            ErrorUtilities.VerifyThrowInternalNull(onErrorChildren, "onErrorChildren");

            _name                                  = name;
            _condition                             = condition;
            _inputs                                = inputs;
            _outputs                               = outputs;
            _returns                               = returns;
            _keepDuplicateOutputs                  = keepDuplicateOutputs;
            _dependsOnTargets                      = dependsOnTargets;
            _location                              = location;
            _conditionLocation                     = conditionLocation;
            _inputsLocation                        = inputsLocation;
            _outputsLocation                       = outputsLocation;
            _returnsLocation                       = returnsLocation;
            _keepDuplicateOutputsLocation          = keepDuplicateOutputsLocation;
            _dependsOnTargetsLocation              = dependsOnTargetsLocation;
            _beforeTargetsLocation                 = beforeTargetsLocation;
            _afterTargetsLocation                  = afterTargetsLocation;
            _children                              = children;
            _onErrorChildren                       = onErrorChildren;
            _parentProjectSupportsReturnsAttribute = parentProjectSupportsReturnsAttribute;
        }
        void ITranslatable.Translate(ITranslator translator)
        {
            translator.Translate(ref _name);
            translator.Translate(ref _condition);
            translator.Translate(ref _inputs);
            translator.Translate(ref _outputs);
            translator.Translate(ref _returns);
            translator.Translate(ref _keepDuplicateOutputs);
            translator.Translate(ref _dependsOnTargets);
            translator.Translate(ref _beforeTargets);
            translator.Translate(ref _afterTargets);
            translator.Translate(ref _location, ElementLocation.FactoryForDeserialization);
            translator.Translate(ref _conditionLocation, ElementLocation.FactoryForDeserialization);
            translator.Translate(ref _inputsLocation, ElementLocation.FactoryForDeserialization);
            translator.Translate(ref _outputsLocation, ElementLocation.FactoryForDeserialization);
            translator.Translate(ref _returnsLocation, ElementLocation.FactoryForDeserialization);
            translator.Translate(ref _keepDuplicateOutputsLocation, ElementLocation.FactoryForDeserialization);
            translator.Translate(ref _dependsOnTargetsLocation, ElementLocation.FactoryForDeserialization);
            translator.Translate(ref _beforeTargetsLocation, ElementLocation.FactoryForDeserialization);
            translator.Translate(ref _afterTargetsLocation, ElementLocation.FactoryForDeserialization);
            translator.Translate(ref _parentProjectSupportsReturnsAttribute);

            var children = _children;

            translator.Translate(ref children, ProjectTargetInstanceChild.FactoryForDeserialization, count => new List <ProjectTargetInstanceChild>(count));

            IList <ProjectOnErrorInstance> onErrorChildren = _onErrorChildren;

            translator.Translate(ref onErrorChildren, ProjectOnErrorInstance.FactoryForDeserialization, count => new List <ProjectOnErrorInstance>(count));

            if (translator.Mode == TranslationDirection.ReadFromStream)
            {
                _children        = new ObjectModel.ReadOnlyCollection <ProjectTargetInstanceChild>(children);
                _onErrorChildren = new ObjectModel.ReadOnlyCollection <ProjectOnErrorInstance>(onErrorChildren);
            }
        }
示例#3
0
        /// <summary>
        /// Constructor called by Evaluator.
        /// All parameters are in the unevaluated state.
        /// All location parameters may be null if not applicable, except for the main location parameter.
        /// </summary>
        internal ProjectTargetInstance
            (
            string name,
            string condition,
            string inputs,
            string outputs,
            string returns,
            string keepDuplicateOutputs,
            string dependsOnTargets,
            ElementLocation location,
            ElementLocation conditionLocation,
            ElementLocation inputsLocation,
            ElementLocation outputsLocation,
            ElementLocation returnsLocation,
            ElementLocation keepDuplicateOutputsLocation,
            ElementLocation dependsOnTargetsLocation,
            ElementLocation beforeTargetsLocation,
            ElementLocation afterTargetsLocation,
            ObjectModel.ReadOnlyCollection<ProjectTargetInstanceChild> children,
            ObjectModel.ReadOnlyCollection<ProjectOnErrorInstance> onErrorChildren,
            bool parentProjectSupportsReturnsAttribute
            )
        {
            ErrorUtilities.VerifyThrowInternalLength(name, "name");
            ErrorUtilities.VerifyThrowInternalNull(condition, "condition");
            ErrorUtilities.VerifyThrowInternalNull(inputs, "inputs");
            ErrorUtilities.VerifyThrowInternalNull(outputs, "outputs");
            ErrorUtilities.VerifyThrowInternalNull(keepDuplicateOutputs, "keepDuplicateOutputs");
            ErrorUtilities.VerifyThrowInternalNull(dependsOnTargets, "dependsOnTargets");
            ErrorUtilities.VerifyThrowInternalNull(location, "location");
            ErrorUtilities.VerifyThrowInternalNull(children, "children");
            ErrorUtilities.VerifyThrowInternalNull(onErrorChildren, "onErrorChildren");

            _name = name;
            _condition = condition;
            _inputs = inputs;
            _outputs = outputs;
            _returns = returns;
            _keepDuplicateOutputs = keepDuplicateOutputs;
            _dependsOnTargets = dependsOnTargets;
            _location = location;
            _conditionLocation = conditionLocation;
            _inputsLocation = inputsLocation;
            _outputsLocation = outputsLocation;
            _returnsLocation = returnsLocation;
            _keepDuplicateOutputsLocation = keepDuplicateOutputsLocation;
            _dependsOnTargetsLocation = dependsOnTargetsLocation;
            _beforeTargetsLocation = beforeTargetsLocation;
            _afterTargetsLocation = afterTargetsLocation;
            _children = children;
            _onErrorChildren = onErrorChildren;
            _parentProjectSupportsReturnsAttribute = parentProjectSupportsReturnsAttribute;
        }