/* * Copyright (c) 2018 iTAC Software AG, Germany. All Rights Reserved. * * This software is protected by copyright. Under no circumstances may any part of this file in any form be copied, * printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language * without the written permission of iTAC Software AG. */ // created 06.11.2018 11:58:58 using System; using System.Collections.Generic; namespace com.itac.oib.siplacesetupcenter.contracts.data { // source: assembly 5.1.0.84 // source: assembly ASM.AS.OIB.SIPLACESetupCenter.Contracts public class ComponentLocationMapper : FeederLocationMapper { // used for itac->asm: True // used for asm->itac: True // maps iTAC namespace conform type to ASM namespace type public static www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.ComponentLocation get(ComponentLocation itacComponentLocation) { if (itacComponentLocation == null) { return null; } www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.ComponentLocation asmComponentLocation = new www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.ComponentLocation(); mapItac2Asm(asmComponentLocation, itacComponentLocation); return asmComponentLocation; } public static void mapItac2Asm(www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.ComponentLocation asmComponentLocation, ComponentLocation itacComponentLocation) { asmComponentLocation.Division = itacComponentLocation.Division; asmComponentLocation.Level = itacComponentLocation.Level; asmComponentLocation.Tower = itacComponentLocation.Tower; asmComponentLocation.StationTrack = itacComponentLocation.StationTrack; } // maps iTAC namespace conform array to ASM namespace array public static www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.ComponentLocation[] get(ComponentLocation[] itacComponentLocation) { if (itacComponentLocation == null) { return null; } www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.ComponentLocation[] asmComponentLocation = new www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.ComponentLocation[itacComponentLocation.Length]; for (int i = 0; i < itacComponentLocation.Length; i++) { // to itac array asmComponentLocation[i] = ComponentLocationMapper.get(itacComponentLocation[i]); } return asmComponentLocation; } // maps iTAC namespace conform array to ASM namespace list public static List getList(ComponentLocation[] asmComponentLocation) { if (asmComponentLocation == null) { return null; } List itacComponentLocation = new List(); for (int i = 0; i < asmComponentLocation.Length; i++) { itacComponentLocation.Add(ComponentLocationMapper.get(asmComponentLocation[i])); } return itacComponentLocation; } // map type from ASM namespace to iTAC namespace public static ComponentLocation get(www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.ComponentLocation asmComponentLocation) { if (asmComponentLocation == null) { return null; } ComponentLocation itacComponentLocation = new ComponentLocation(); mapAsm2Itac(asmComponentLocation, itacComponentLocation); return itacComponentLocation; } public static void mapAsm2Itac(www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.ComponentLocation asmComponentLocation, ComponentLocation itacComponentLocation) { FeederLocationMapper.mapAsm2Itac(asmComponentLocation, itacComponentLocation); itacComponentLocation.Division = asmComponentLocation.Division; itacComponentLocation.Level = asmComponentLocation.Level; itacComponentLocation.Tower = asmComponentLocation.Tower; itacComponentLocation.StationTrack = asmComponentLocation.StationTrack; } // maps ASM namespace conform list to iTAC namespace array public static ComponentLocation[] getArray(IList asmComponentLocation) { if (asmComponentLocation == null) { return null; } ComponentLocation[] itacComponentLocation = new ComponentLocation[asmComponentLocation.Count]; for (int i = 0; i < asmComponentLocation.Count; i++) { itacComponentLocation[i] = ComponentLocationMapper.get(asmComponentLocation[i]); } return itacComponentLocation; } // maps ASM namespace conform array to iTAC namespace array public static ComponentLocation[] getArray(www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.ComponentLocation[] asmComponentLocation) { if (asmComponentLocation == null) { return null; } ComponentLocation[] itacComponentLocation = new ComponentLocation[asmComponentLocation.Length]; for (int i = 0; i < asmComponentLocation.Length; i++) { itacComponentLocation[i] = ComponentLocationMapper.get(asmComponentLocation[i]); } return itacComponentLocation; } } }