/// <summary>
        /// Initializes a new instance of the <see cref="BinarySelectorElement"/> class.
        /// </summary>
        public BinarySelectorElement(SelectorElementBase left, SelectorElementBase right, CombinatorElementBase combinatorElement)
        {
            Assume.NotNull(left, nameof(left));
            Assume.NotNull(right, nameof(right));
            Assume.NotNull(combinatorElement, nameof(combinatorElement));

            Left              = left;
            Right             = right;
            CombinatorElement = combinatorElement;
        }
示例#2
0
        /// <summary>
        /// Creates the specified selectorElement.
        /// </summary>
        public CombinatorBase Create(SelectorElementBase selectorElement)
        {
            Assume.NotNull(selectorElement, nameof(selectorElement));

            if (selectorElement is UnarySelectorElement)
            {
                var unarySelector = (UnarySelectorElement)selectorElement;
                return(create(unarySelector));
            }

            if (selectorElement is BinarySelectorElement)
            {
                var binarySelector = (BinarySelectorElement)selectorElement;
                return(create(binarySelector));
            }

            throw new NotSupportedException(
                      $"Not supported selector element type: {selectorElement.GetType().FullName}.");
        }
        /// <summary>
        /// Creates the specified selectorElement.
        /// </summary>
        public CombinatorBase Create(SelectorElementBase selectorElement)
        {
            Assume.NotNull(selectorElement, nameof(selectorElement));

            if (selectorElement is UnarySelectorElement)
            {
                var unarySelector = (UnarySelectorElement) selectorElement;
                return create(unarySelector);
            }

            if (selectorElement is BinarySelectorElement)
            {
                var binarySelector = (BinarySelectorElement) selectorElement;
                return create(binarySelector);
            }

            throw new NotSupportedException(
                $"Not supported selector element type: {selectorElement.GetType().FullName}.");
        }
 /// <summary>
 /// Creates the binary selectorElement.
 /// </summary>
 public BinarySelectorElement CreateBinarySelector(SelectorElementBase left, SelectorElementBase right, CombinatorElementBase selectorOperator)
 {
     return new BinarySelectorElement(left, right, selectorOperator);
 }
 /// <summary>
 /// Creates the binary selectorElement.
 /// </summary>
 public BinarySelectorElement CreateBinarySelector(SelectorElementBase left, SelectorElementBase right, CombinatorElementBase selectorOperator)
 {
     return(new BinarySelectorElement(left, right, selectorOperator));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SelectorControlFlowElement"/> class.
 /// </summary>
 public SelectorControlFlowElement(SelectorElementBase selectorElement) : base(ControlFlowOperationType.Selector)
 {
     Assume.NotNull(selectorElement, nameof(selectorElement));
     SelectorElement = selectorElement;
 }
 /// <summary>
 /// Creates a control flow for selection.
 /// </summary>
 public ControlFlowElementBase CreateControlFlow(SelectorElementBase selectorElement)
 {
     Assume.NotNull(selectorElement, nameof(selectorElement));
     return(new SelectorControlFlowElement(selectorElement));
 }
 /// <summary>
 /// Creates a control flow for selection.
 /// </summary>
 public ControlFlowElementBase CreateControlFlow(SelectorElementBase selectorElement)
 {
     Assume.NotNull(selectorElement, nameof(selectorElement));
     return new SelectorControlFlowElement(selectorElement);
 }
示例#9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SelectorControlFlowElement"/> class.
 /// </summary>
 public SelectorControlFlowElement(SelectorElementBase selectorElement) : base(ControlFlowOperationType.Selector)
 {
     Assume.NotNull(selectorElement, nameof(selectorElement));
     SelectorElement = selectorElement;
 }