/* * 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:07:38 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 PrinterMaterialMapper:PrinterVerificationItemMapper { // used for itac->asm: True // used for asm->itac: True // maps iTAC namespace conform type to ASM namespace type public static Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterMaterial get(PrinterMaterial itacPrinterMaterial) { if (itacPrinterMaterial == null) { return null; } Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterMaterial asmPrinterMaterial = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterMaterial(); mapItac2Asm(asmPrinterMaterial, itacPrinterMaterial); return asmPrinterMaterial; } public static void mapItac2Asm(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterMaterial asmPrinterMaterial, PrinterMaterial itacPrinterMaterial) { // complex property Machine, isArray:False, isGeneric:False asmPrinterMaterial.Machine = com.itac.oib.siplacesetupcenter.contracts.data.MachineLocatorMapper.get( itacPrinterMaterial.Machine); asmPrinterMaterial.SetupPath = itacPrinterMaterial.SetupPath; // complex property ProductInfo, isArray:False, isGeneric:False asmPrinterMaterial.ProductInfo = com.itac.oib.siplacesetupcenter.contracts.data.ProductInfoMapper.get( itacPrinterMaterial.ProductInfo); asmPrinterMaterial.Name = itacPrinterMaterial.Name; } // maps iTAC namespace conform array to ASM namespace array public static Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterMaterial[] get(PrinterMaterial[] itacPrinterMaterial) { if (itacPrinterMaterial == null) { return null; } Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterMaterial[] asmPrinterMaterial = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterMaterial[itacPrinterMaterial.Length]; for (int i = 0; i < itacPrinterMaterial.Length; i++) { // to itac array asmPrinterMaterial[i] = PrinterMaterialMapper.get(itacPrinterMaterial[i]); } return asmPrinterMaterial; } // maps iTAC namespace conform array to ASM namespace list public static List getList(PrinterMaterial[] asmPrinterMaterial) { if (asmPrinterMaterial == null) { return null; } List itacPrinterMaterial = new List(); for (int i = 0; i < asmPrinterMaterial.Length; i++) { itacPrinterMaterial.Add(PrinterMaterialMapper.get(asmPrinterMaterial[i])); } return itacPrinterMaterial; } // map type from ASM namespace to iTAC namespace public static PrinterMaterial get(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterMaterial asmPrinterMaterial) { if (asmPrinterMaterial == null) { return null; } PrinterMaterial itacPrinterMaterial = new PrinterMaterial(); mapAsm2Itac(asmPrinterMaterial, itacPrinterMaterial); return itacPrinterMaterial; } public static void mapAsm2Itac(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterMaterial asmPrinterMaterial, PrinterMaterial itacPrinterMaterial) { PrinterVerificationItemMapper.mapAsm2Itac(asmPrinterMaterial, itacPrinterMaterial); itacPrinterMaterial.Machine = com.itac.oib.siplacesetupcenter.contracts.data.MachineLocatorMapper.get(asmPrinterMaterial.Machine); // complex asm property Machine itacPrinterMaterial.SetupPath = asmPrinterMaterial.SetupPath; itacPrinterMaterial.ProductInfo = com.itac.oib.siplacesetupcenter.contracts.data.ProductInfoMapper.get(asmPrinterMaterial.ProductInfo); // complex asm property ProductInfo itacPrinterMaterial.Name = asmPrinterMaterial.Name; } // maps ASM namespace conform list to iTAC namespace array public static PrinterMaterial[] getArray(IList asmPrinterMaterial) { if (asmPrinterMaterial == null) { return null; } PrinterMaterial[] itacPrinterMaterial = new PrinterMaterial[asmPrinterMaterial.Count]; for (int i = 0; i < asmPrinterMaterial.Count; i++) { itacPrinterMaterial[i] = PrinterMaterialMapper.get(asmPrinterMaterial[i]); } return itacPrinterMaterial; } // maps ASM namespace conform array to iTAC namespace array public static PrinterMaterial[] getArray(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterMaterial[] asmPrinterMaterial) { if (asmPrinterMaterial == null) { return null; } PrinterMaterial[] itacPrinterMaterial = new PrinterMaterial[asmPrinterMaterial.Length]; for (int i = 0; i < asmPrinterMaterial.Length; i++) { itacPrinterMaterial[i] = PrinterMaterialMapper.get(asmPrinterMaterial[i]); } return itacPrinterMaterial; } } }