/* * 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 // skip property Int32 in this type 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 PrinterConsumableMapper { // 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.PrinterConsumable get(PrinterConsumable itacPrinterConsumable) { if (itacPrinterConsumable == null) { return null; } Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterConsumable asmPrinterConsumable = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterConsumable(); mapItac2Asm(asmPrinterConsumable, itacPrinterConsumable); return asmPrinterConsumable; } public static void mapItac2Asm(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterConsumable asmPrinterConsumable, PrinterConsumable itacPrinterConsumable) { asmPrinterConsumable.ConsumableName = itacPrinterConsumable.ConsumableName; asmPrinterConsumable.ConsumableId = itacPrinterConsumable.ConsumableId; asmPrinterConsumable.FillLevel = itacPrinterConsumable.FillLevel; // skip property Int32 in this type asmPrinterConsumable.PrinterValidationStatus = itacPrinterConsumable.PrinterValidationStatus; } // maps iTAC namespace conform array to ASM namespace array public static Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterConsumable[] get(PrinterConsumable[] itacPrinterConsumable) { if (itacPrinterConsumable == null) { return null; } Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterConsumable[] asmPrinterConsumable = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterConsumable[itacPrinterConsumable.Length]; for (int i = 0; i < itacPrinterConsumable.Length; i++) { // to itac array asmPrinterConsumable[i] = PrinterConsumableMapper.get(itacPrinterConsumable[i]); } return asmPrinterConsumable; } // maps iTAC namespace conform array to ASM namespace list public static List getList(PrinterConsumable[] asmPrinterConsumable) { if (asmPrinterConsumable == null) { return null; } List itacPrinterConsumable = new List(); for (int i = 0; i < asmPrinterConsumable.Length; i++) { itacPrinterConsumable.Add(PrinterConsumableMapper.get(asmPrinterConsumable[i])); } return itacPrinterConsumable; } // map type from ASM namespace to iTAC namespace public static PrinterConsumable get(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterConsumable asmPrinterConsumable) { if (asmPrinterConsumable == null) { return null; } PrinterConsumable itacPrinterConsumable = new PrinterConsumable(); mapAsm2Itac(asmPrinterConsumable, itacPrinterConsumable); return itacPrinterConsumable; } public static void mapAsm2Itac(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterConsumable asmPrinterConsumable, PrinterConsumable itacPrinterConsumable) { itacPrinterConsumable.ConsumableName = asmPrinterConsumable.ConsumableName; itacPrinterConsumable.ConsumableId = asmPrinterConsumable.ConsumableId; itacPrinterConsumable.FillLevel = asmPrinterConsumable.FillLevel; // skip property Int32 in this type itacPrinterConsumable.PrinterValidationStatus = asmPrinterConsumable.PrinterValidationStatus; } // maps ASM namespace conform list to iTAC namespace array public static PrinterConsumable[] getArray(IList asmPrinterConsumable) { if (asmPrinterConsumable == null) { return null; } PrinterConsumable[] itacPrinterConsumable = new PrinterConsumable[asmPrinterConsumable.Count]; for (int i = 0; i < asmPrinterConsumable.Count; i++) { itacPrinterConsumable[i] = PrinterConsumableMapper.get(asmPrinterConsumable[i]); } return itacPrinterConsumable; } // maps ASM namespace conform array to iTAC namespace array public static PrinterConsumable[] getArray(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.PrinterConsumable[] asmPrinterConsumable) { if (asmPrinterConsumable == null) { return null; } PrinterConsumable[] itacPrinterConsumable = new PrinterConsumable[asmPrinterConsumable.Length]; for (int i = 0; i < asmPrinterConsumable.Length; i++) { itacPrinterConsumable[i] = PrinterConsumableMapper.get(asmPrinterConsumable[i]); } return itacPrinterConsumable; } } }