/* * 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 05.11.2018 14:52:23 // skip property DictionaryProxy`2, property in exclude list // skip property ListProxy`1, property in exclude list using System; using System.Collections.Generic; namespace com.itac.oib.siplacepro.contracts.data { // source: assembly 5.1.0.84 // source: assembly ASM.AS.OIB.SIPLACEPro.Proxy public class PrinterSetupMapper { // used for itac->asm: True // used for asm->itac: True // maps iTAC namespace conform type to ASM namespace type public static Asm.As.Oib.SiplacePro.Proxy.Business.Objects.PrinterSetup get(PrinterSetup itacPrinterSetup) { if (itacPrinterSetup == null) { return null; } Asm.As.Oib.SiplacePro.Proxy.Business.Objects.PrinterSetup asmPrinterSetup = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.PrinterSetup(); mapItac2Asm(asmPrinterSetup, itacPrinterSetup); return asmPrinterSetup; } public static void mapItac2Asm(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.PrinterSetup asmPrinterSetup, PrinterSetup itacPrinterSetup) { // skip readonly property Line // skip property DictionaryProxy`2, property in exclude list // skip property ListProxy`1, property in exclude list // skip readonly property Name // skip readonly property FullPath } // maps iTAC namespace conform array to ASM namespace array public static Asm.As.Oib.SiplacePro.Proxy.Business.Objects.PrinterSetup[] get(PrinterSetup[] itacPrinterSetup) { if (itacPrinterSetup == null) { return null; } Asm.As.Oib.SiplacePro.Proxy.Business.Objects.PrinterSetup[] asmPrinterSetup = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.PrinterSetup[itacPrinterSetup.Length]; for (int i = 0; i < itacPrinterSetup.Length; i++) { // to itac array asmPrinterSetup[i] = PrinterSetupMapper.get(itacPrinterSetup[i]); } return asmPrinterSetup; } // maps iTAC namespace conform array to ASM namespace list public static List getList(PrinterSetup[] asmPrinterSetup) { if (asmPrinterSetup == null) { return null; } List itacPrinterSetup = new List(); for (int i = 0; i < asmPrinterSetup.Length; i++) { itacPrinterSetup.Add(PrinterSetupMapper.get(asmPrinterSetup[i])); } return itacPrinterSetup; } // map type from ASM namespace to iTAC namespace public static PrinterSetup get(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.PrinterSetup asmPrinterSetup) { if (asmPrinterSetup == null) { return null; } PrinterSetup itacPrinterSetup = new PrinterSetup(); mapAsm2Itac(asmPrinterSetup, itacPrinterSetup); return itacPrinterSetup; } public static void mapAsm2Itac(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.PrinterSetup asmPrinterSetup, PrinterSetup itacPrinterSetup) { itacPrinterSetup.Line = com.itac.oib.siplacepro.contracts.data.LineMapper.get(asmPrinterSetup.Line); // complex asm property Line // skip property DictionaryProxy`2, property in exclude list // skip property ListProxy`1, property in exclude list itacPrinterSetup.Name = asmPrinterSetup.Name; itacPrinterSetup.FullPath = asmPrinterSetup.FullPath; } // maps ASM namespace conform list to iTAC namespace array public static PrinterSetup[] getArray(IList asmPrinterSetup) { if (asmPrinterSetup == null) { return null; } PrinterSetup[] itacPrinterSetup = new PrinterSetup[asmPrinterSetup.Count]; for (int i = 0; i < asmPrinterSetup.Count; i++) { itacPrinterSetup[i] = PrinterSetupMapper.get(asmPrinterSetup[i]); } return itacPrinterSetup; } // maps ASM namespace conform array to iTAC namespace array public static PrinterSetup[] getArray(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.PrinterSetup[] asmPrinterSetup) { if (asmPrinterSetup == null) { return null; } PrinterSetup[] itacPrinterSetup = new PrinterSetup[asmPrinterSetup.Length]; for (int i = 0; i < asmPrinterSetup.Length; i++) { itacPrinterSetup[i] = PrinterSetupMapper.get(asmPrinterSetup[i]); } return itacPrinterSetup; } } }