-
Notifications
You must be signed in to change notification settings - Fork 5
RedirectIndexer Code Mapping Action
ldfallas edited this page Aug 31, 2015
·
3 revisions
<map:RedirectIndexer ToProperty="PROPERTY-NAME" />
Replaces references to an indexer property with an indexer of an inner property.
For example it can change from A["X"]
to A.B["X"]
.
Property | Usage | Description |
---|---|---|
ToProperty | Required | Indicates the name of the inner property to redirect the call to |
Say that we want to replace the System.IO.IsolatedStorage.IsolatedStorageSettings[]
method calls to call to the Windows.Storage.ApplicationDataContainer.Values[]
indexer.
The mapping for this scenario looks like this;
<?xml version="1.0" encoding="utf-8"?>
<MapUnit xmlns="clr-namespace:Mobilize.Mappers.Extensibility.Core;assembly=Mobilize.ExtensibleMappers"
xmlns:map="clr-namespace:Mobilize.Mappers.Extensibility.Code;assembly=Mobilize.ExtensibleMappers">
<MapUnit.Elements>
<map:CodeMapPackage Type="System.IO.IsolatedStorage.IsolatedStorageSettings">
<map:CodeMapPackage.Maps>
...
<map:CodeMap Kind="ElementAccess">
<map:CodeMap.Action>
<map:RedirectIndexer ToProperty="Values" />
</map:CodeMap.Action>
</map:CodeMap>
...
</map:CodeMapPackage.Maps>
</map:CodeMapPackage>
</MapUnit.Elements>
</MapUnit>
- This mapping action only works on
CodeMap
s of kindElementAccess
.
Contact us for more information
Overview
Writing mappings
Code Mapping Actions
- ActionSequence
- AddHelper
- AddNamespaceImport
- AddPreStatementFromTemplate
- CommentOut
- Conditional
- Keep Code Mapping Action
- MarkAsNotMapped
- RedirectCall
- RedirectCallToInnerMember
- RedirectIndexer
- RedirectProperty
- RemoveCurrentStatement
- RemoveParameter
- ReplaceClassUsage
- ReplaceMethodBodyWithTemplate
- ReplaceParameterDeclarationType
- ReplaceParameterMember
- ReplaceParameterValue
- ReplaceWithMethodCall
- ReplaceWithProperty
- ReplaceWithTemplate
Code Mapping Conditions
- AllConditionsApply
- ArgumentCount
- AssignName
- AssignNameToArgumentRange
- IsExpressionOfType
- IsStringLiteralMatchingRegex
- WithArgument
- WithAssignment
- WithAssignmentLeftSide
- WithAssignmentRightSide
- WithCalledMemberOwner
- WithCalledMethodExpression
- WithConstructorCall
- WithLambdaExpressionBody
- WithLambdaExpressionParameter
- WithLeftSideOfDottedAccess
- WithMemberInitValue
- WithMethodCall
XAML mapping actions
- ActionSequence
- AddStatementToConstructorFromTemplate
- BindPropertyValueElement Xaml mapping action
- ChangeEventHandlerEventArgsType
- CommentOutElement
- CommentOutProperty
- MarkAsNotMapped
- MoveValueToContentProperty
- RemoveNamespaceDeclaration
- RenameElement
- RenameProperty
- ReplaceAttributeValue
- ReplaceEventHandlerBodyWithTemplate
- ReplaceEventHandlerParameterMember
- ReplaceNamespaceDeclaration
- ReplacePropertyValueWithParentResource
- ReplaceStaticResourceWithThemeResource
- SetPropertyValueToComplexElement
- SetPropertyValueToSimpleValue
- WrapContent
XAML mapping conditions
Misc