Skip to content

MarkAsNotMapped Code Action

ldfallas edited this page Aug 31, 2015 · 3 revisions

Description

This mapping action generates an entry in the conversion report that indicates the target element (method, property, class) has no equivalent on the target platform.

Properties

This mapping action has no properties.

Example

Say that we want to mark uses of the LongListSelector.IsGroupingEnabled property as "not mapped". The following mapper definition shows how to use the MarkAsNotMapped code action to do this.

<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="Microsoft.Phone.Controls.LongListSelector">
      <map:CodeMapPackage.Maps>

        <map:CodeMap Kind="Type">
          <map:CodeMap.Action>
              <map:ReplaceClassUsage NewNamespace="Windows.UI.Xaml.Controls" NewClassName="GridView" />
          </map:CodeMap.Action>
        </map:CodeMap>

        <map:CodeMap Kind="MemberAccess" MemberName="IsGroupingEnabled">
          <map:CodeMap.Action>
            <map:MarkAsNotMapped/>
          </map:CodeMap.Action>
        </map:CodeMap>

      </map:CodeMapPackage.Maps>
    </map:CodeMapPackage>
  </MapUnit.Elements>
</MapUnit>

After applying this action the target code will generate a comment that indicates that this element requires attention.For example:

//WINDOWS_PHONE_SL_TO_UWP: (1101) Microsoft.Phone.Controls.LongListSelector.IsGroupingEnabled was not upgraded
ContactsList.IsGroupingEnabled = true;

Notes

TODO

Overview

Writing mappings

Code Mapping Actions

Code Mapping Conditions

XAML mapping actions

XAML mapping conditions

Misc

Clone this wiki locally