Skip to content

RedirectCallToInnerMember Code Action

ldfallas edited this page Aug 31, 2015 · 3 revisions

Description

Changes the method to be called for a call to an inner member.

This action can be used to change calls for A.SourceMethod() to A.B.TargetMethod() .

Properties

Property ​Usage ​Description
​NewMethod ​Required The name of the new method to be called
​NewMethodOwner Optional An optional name for the new method owner

Example

Say that we want to replace the System.IO.IsolatedStorage.IsolatedStorageSettings.Add method calls to call to the Windows.Storage.ApplicationDataContainer.Values.Add method.

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="Call" MemberName="Add">
          <map:CodeMap.Action>
            <map:RedirectCallToInnerMember NewMethod="Add" NewMethodOwner="Values" />
          </map:CodeMap.Action>
        </map:CodeMap>
        ...
      </map:CodeMapPackage.Maps>
     </map:CodeMapPackage>
	</MapUnit.Elements>
</MapUnit>

Notes

TODO

Overview

Writing mappings

Code Mapping Actions

Code Mapping Conditions

XAML mapping actions

XAML mapping conditions

Misc

Clone this wiki locally