Skip to content

AllConditionsApply Code Mapping Condition

ldfallas edited this page Aug 17, 2015 · 2 revisions

Usage

<map:AllConditionsApply>
  ... inner conditions ...
</map:AllConditionsApply>

Description

Succeeds if all inner conditions apply.

This code mapping action acts as a container for code mapping conditions.

Properties

​Property ​Usage ​Description
SubConditions Content property List of conditions which should succeed for the container to succeed

Example

The following example shows how to combine this mapping condition with others:

...
<map:WithConstructorCall>
  <map:AllConditionsApply>
    <map:ArgumentCount>2</map:ArgumentCount>
    <map:WithArgument Position="0">
      <map:AllConditionsApply>
        <map:AssignName>$uriString</map:AssignName>
        <map:IsStringLiteralMatchingRegex>^/</map:IsStringLiteralMatchingRegex>
      </map:AllConditionsApply>
    </map:WithArgument>
  </map:AllConditionsApply>
</map:WithConstructorCall>
...

This combined condition verifies that:

  • The current expression is a constructor call (new CLASS-NAME) (WithConstructorCall)
  • The constructor is invoked with two arguments (ArgumentCount)
  • The first argument is a string literal starting with /, it will be bound to $uriString (WithArgument, AssignName, IsStringLiteralMatchingRegex)

Notes

  • After the first condition fails the complete condition fails (it short circuits)

Overview

Writing mappings

Code Mapping Actions

Code Mapping Conditions

XAML mapping actions

XAML mapping conditions

Misc

Clone this wiki locally