/* * 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:08:14 // skip property DictionaryProxy`2, property in exclude list // skip property ListProxy`1, property in exclude list // skip property BoardWidthRestriction, property in exclude list // skip property ListProxy`1, property in exclude list using System; using System.Collections.Generic; using com.itac.oib.siplacepro.contracts.types; namespace com.itac.oib.siplacepro.contracts.data { // source: assembly 3.2.0.152 // source: assembly ASM.AS.OIB.SIPLACEPro.Proxy public class LineMapper { // 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.Line get(Line itacLine) { if (itacLine == null) { return null; } Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line asmLine = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line(); mapItac2Asm(asmLine, itacLine); return asmLine; } public static void mapItac2Asm(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line asmLine, Line itacLine) { // skip readonly property StationInLines // complex property StationInLineOptions, isArray:False, isGeneric:False asmLine.StationInLineOptions = com.itac.oib.siplacepro.contracts.types.StationInLineOptionsMapper.get( itacLine.StationInLineOptions); // complex property LineHandlingOptions, isArray:False, isGeneric:False asmLine.LineHandlingOptions = com.itac.oib.siplacepro.contracts.types.LineHandlingOptionsMapper.get( itacLine.LineHandlingOptions); // skip property DictionaryProxy`2, property in exclude list // skip property ListProxy`1, property in exclude list // skip property BoardWidthRestriction, property in exclude list // skip property ListProxy`1, property in exclude list asmLine.IsBoardWidthRestrictionEnabled = itacLine.IsBoardWidthRestrictionEnabled; // 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.Line[] get(Line[] itacLine) { if (itacLine == null) { return null; } Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line[] asmLine = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line[itacLine.Length]; for (int i = 0; i < itacLine.Length; i++) { // to itac array asmLine[i] = LineMapper.get(itacLine[i]); } return asmLine; } // maps iTAC namespace conform array to ASM namespace list public static List getList(Line[] asmLine) { if (asmLine == null) { return null; } List itacLine = new List(); for (int i = 0; i < asmLine.Length; i++) { itacLine.Add(LineMapper.get(asmLine[i])); } return itacLine; } // map type from ASM namespace to iTAC namespace public static Line get(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line asmLine) { if (asmLine == null) { return null; } Line itacLine = new Line(); mapAsm2Itac(asmLine, itacLine); return itacLine; } public static void mapAsm2Itac(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line asmLine, Line itacLine) { // maps ASM list 2 iTAC array itacLine.StationInLines = StationInLineMapper.getArray(asmLine.StationInLines); itacLine.StationInLineOptions = com.itac.oib.siplacepro.contracts.types.StationInLineOptionsMapper.get(asmLine.StationInLineOptions); // complex asm property StationInLineOptions itacLine.LineHandlingOptions = com.itac.oib.siplacepro.contracts.types.LineHandlingOptionsMapper.get(asmLine.LineHandlingOptions); // complex asm property LineHandlingOptions // skip property DictionaryProxy`2, property in exclude list // skip property ListProxy`1, property in exclude list // skip property BoardWidthRestriction, property in exclude list // skip property ListProxy`1, property in exclude list itacLine.IsBoardWidthRestrictionEnabled = asmLine.IsBoardWidthRestrictionEnabled; itacLine.Name = asmLine.Name; itacLine.FullPath = asmLine.FullPath; } // maps ASM namespace conform list to iTAC namespace array public static Line[] getArray(IList asmLine) { if (asmLine == null) { return null; } Line[] itacLine = new Line[asmLine.Count]; for (int i = 0; i < asmLine.Count; i++) { itacLine[i] = LineMapper.get(asmLine[i]); } return itacLine; } // maps ASM namespace conform array to iTAC namespace array public static Line[] getArray(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line[] asmLine) { if (asmLine == null) { return null; } Line[] itacLine = new Line[asmLine.Length]; for (int i = 0; i < asmLine.Length; i++) { itacLine[i] = LineMapper.get(asmLine[i]); } return itacLine; } } }