/* * 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 23.11.2018 08:05:09 // skip property Guid, declared in SubAnswer using System; using System.Collections.Generic; namespace com.itac.oib.displayservice.contracts.data { // source: assembly 3.2.0.152 // source: assembly ASM.AS.OIB.DisplayService.Contracts public class SubAnswerMapper { // used for itac->asm: True // used for asm->itac: True // maps iTAC namespace conform type to ASM namespace type public static Asm.As.Oib.DisplayService.Contracts.Data.SubAnswer get(SubAnswer itacSubAnswer) { if (itacSubAnswer == null) { return null; } Asm.As.Oib.DisplayService.Contracts.Data.SubAnswer asmSubAnswer = new Asm.As.Oib.DisplayService.Contracts.Data.SubAnswer(""); mapItac2Asm(asmSubAnswer, itacSubAnswer); return asmSubAnswer; } public static void mapItac2Asm(Asm.As.Oib.DisplayService.Contracts.Data.SubAnswer asmSubAnswer, SubAnswer itacSubAnswer) { // skip property Guid, declared in SubAnswer } // maps iTAC namespace conform array to ASM namespace array public static Asm.As.Oib.DisplayService.Contracts.Data.SubAnswer[] get(SubAnswer[] itacSubAnswer) { if (itacSubAnswer == null) { return null; } Asm.As.Oib.DisplayService.Contracts.Data.SubAnswer[] asmSubAnswer = new Asm.As.Oib.DisplayService.Contracts.Data.SubAnswer[itacSubAnswer.Length]; for (int i = 0; i < itacSubAnswer.Length; i++) { // to itac array asmSubAnswer[i] = SubAnswerMapper.get(itacSubAnswer[i]); } return asmSubAnswer; } // maps iTAC namespace conform array to ASM namespace list public static List getList(SubAnswer[] asmSubAnswer) { if (asmSubAnswer == null) { return null; } List itacSubAnswer = new List(); for (int i = 0; i < asmSubAnswer.Length; i++) { itacSubAnswer.Add(SubAnswerMapper.get(asmSubAnswer[i])); } return itacSubAnswer; } // map type from ASM namespace to iTAC namespace public static SubAnswer get(Asm.As.Oib.DisplayService.Contracts.Data.SubAnswer asmSubAnswer) { if (asmSubAnswer == null) { return null; } SubAnswer itacSubAnswer = new SubAnswer(); mapAsm2Itac(asmSubAnswer, itacSubAnswer); return itacSubAnswer; } public static void mapAsm2Itac(Asm.As.Oib.DisplayService.Contracts.Data.SubAnswer asmSubAnswer, SubAnswer itacSubAnswer) { // skip property Guid, declared in SubAnswer } // maps ASM namespace conform list to iTAC namespace array public static SubAnswer[] getArray(IList asmSubAnswer) { if (asmSubAnswer == null) { return null; } SubAnswer[] itacSubAnswer = new SubAnswer[asmSubAnswer.Count]; for (int i = 0; i < asmSubAnswer.Count; i++) { itacSubAnswer[i] = SubAnswerMapper.get(asmSubAnswer[i]); } return itacSubAnswer; } // maps ASM namespace conform array to iTAC namespace array public static SubAnswer[] getArray(Asm.As.Oib.DisplayService.Contracts.Data.SubAnswer[] asmSubAnswer) { if (asmSubAnswer == null) { return null; } SubAnswer[] itacSubAnswer = new SubAnswer[asmSubAnswer.Length]; for (int i = 0; i < asmSubAnswer.Length; i++) { itacSubAnswer[i] = SubAnswerMapper.get(asmSubAnswer[i]); } return itacSubAnswer; } } }