/* * 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 15:39:46 // skip property ExtensionDataObject, declared in ErrorStruct using System; using System.Collections.Generic; namespace com.itac.oib.traceability.contracts.data { // source: assembly 3.0.0.0 // source: assembly ASM.AS.OIB.Client public class ErrorStructMapper { // 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._2012._03.Traceability.Contracts.Data.ErrorStruct get(ErrorStruct itacErrorStruct) { if (itacErrorStruct == null) { return null; } www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.ErrorStruct asmErrorStruct = new www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.ErrorStruct(); mapItac2Asm(asmErrorStruct, itacErrorStruct); return asmErrorStruct; } public static void mapItac2Asm(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.ErrorStruct asmErrorStruct, ErrorStruct itacErrorStruct) { // skip property ExtensionDataObject, declared in ErrorStruct asmErrorStruct.ErrorLevel = itacErrorStruct.ErrorLevel; // complex property ErrorReasons, isArray:True, isGeneric:False asmErrorStruct.ErrorReasons = com.itac.oib.traceability.contracts.data.ReasonStructMapper.get( itacErrorStruct.ErrorReasons); } // maps iTAC namespace conform array to ASM namespace array public static www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.ErrorStruct[] get(ErrorStruct[] itacErrorStruct) { if (itacErrorStruct == null) { return null; } www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.ErrorStruct[] asmErrorStruct = new www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.ErrorStruct[itacErrorStruct.Length]; for (int i = 0; i < itacErrorStruct.Length; i++) { // to itac array asmErrorStruct[i] = ErrorStructMapper.get(itacErrorStruct[i]); } return asmErrorStruct; } // maps iTAC namespace conform array to ASM namespace list public static List getList(ErrorStruct[] asmErrorStruct) { if (asmErrorStruct == null) { return null; } List itacErrorStruct = new List(); for (int i = 0; i < asmErrorStruct.Length; i++) { itacErrorStruct.Add(ErrorStructMapper.get(asmErrorStruct[i])); } return itacErrorStruct; } // map type from ASM namespace to iTAC namespace public static ErrorStruct get(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.ErrorStruct asmErrorStruct) { if (asmErrorStruct == null) { return null; } ErrorStruct itacErrorStruct = new ErrorStruct(); mapAsm2Itac(asmErrorStruct, itacErrorStruct); return itacErrorStruct; } public static void mapAsm2Itac(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.ErrorStruct asmErrorStruct, ErrorStruct itacErrorStruct) { // skip property ExtensionDataObject, declared in ErrorStruct itacErrorStruct.ErrorLevel = asmErrorStruct.ErrorLevel; // array mapping itacErrorStruct.ErrorReasons = ReasonStructMapper.getArray(asmErrorStruct.ErrorReasons); // complex asm property ErrorReasons } // maps ASM namespace conform list to iTAC namespace array public static ErrorStruct[] getArray(IList asmErrorStruct) { if (asmErrorStruct == null) { return null; } ErrorStruct[] itacErrorStruct = new ErrorStruct[asmErrorStruct.Count]; for (int i = 0; i < asmErrorStruct.Count; i++) { itacErrorStruct[i] = ErrorStructMapper.get(asmErrorStruct[i]); } return itacErrorStruct; } // maps ASM namespace conform array to iTAC namespace array public static ErrorStruct[] getArray(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.ErrorStruct[] asmErrorStruct) { if (asmErrorStruct == null) { return null; } ErrorStruct[] itacErrorStruct = new ErrorStruct[asmErrorStruct.Length]; for (int i = 0; i < asmErrorStruct.Length; i++) { itacErrorStruct[i] = ErrorStructMapper.get(asmErrorStruct[i]); } return itacErrorStruct; } } }