102 lines
4.2 KiB
C#
102 lines
4.2 KiB
C#
/*
|
|
* 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 PrinterTooling
|
|
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 PrinterToolingMapper
|
|
{
|
|
// 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.PrinterTooling get(PrinterTooling itacPrinterTooling)
|
|
{
|
|
if (itacPrinterTooling == null) { return null; }
|
|
www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterTooling asmPrinterTooling = new www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterTooling();
|
|
mapItac2Asm(asmPrinterTooling, itacPrinterTooling);
|
|
return asmPrinterTooling;
|
|
}
|
|
|
|
public static void mapItac2Asm(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterTooling asmPrinterTooling, PrinterTooling itacPrinterTooling)
|
|
{
|
|
// skip property ExtensionDataObject, declared in PrinterTooling
|
|
asmPrinterTooling.ToolingType = itacPrinterTooling.ToolingType;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterTooling[] get(PrinterTooling[] itacPrinterTooling)
|
|
{
|
|
if (itacPrinterTooling == null) { return null; }
|
|
www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterTooling[] asmPrinterTooling = new www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterTooling[itacPrinterTooling.Length];
|
|
for (int i = 0; i < itacPrinterTooling.Length; i++)
|
|
{
|
|
// to itac array
|
|
asmPrinterTooling[i] = PrinterToolingMapper.get(itacPrinterTooling[i]);
|
|
}
|
|
return asmPrinterTooling;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterTooling> getList(PrinterTooling[] asmPrinterTooling)
|
|
{
|
|
if (asmPrinterTooling == null) { return null; }
|
|
List<www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterTooling> itacPrinterTooling = new List<www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterTooling>();
|
|
for (int i = 0; i < asmPrinterTooling.Length; i++)
|
|
{
|
|
itacPrinterTooling.Add(PrinterToolingMapper.get(asmPrinterTooling[i]));
|
|
}
|
|
return itacPrinterTooling;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static PrinterTooling get(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterTooling asmPrinterTooling)
|
|
{
|
|
if (asmPrinterTooling == null) { return null; }
|
|
PrinterTooling itacPrinterTooling = new PrinterTooling();
|
|
mapAsm2Itac(asmPrinterTooling, itacPrinterTooling);
|
|
return itacPrinterTooling;
|
|
}
|
|
|
|
public static void mapAsm2Itac(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterTooling asmPrinterTooling, PrinterTooling itacPrinterTooling)
|
|
{
|
|
// skip property ExtensionDataObject, declared in PrinterTooling
|
|
itacPrinterTooling.ToolingType = asmPrinterTooling.ToolingType;
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static PrinterTooling[] getArray(IList<www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterTooling> asmPrinterTooling)
|
|
{
|
|
if (asmPrinterTooling == null) { return null; }
|
|
PrinterTooling[] itacPrinterTooling = new PrinterTooling[asmPrinterTooling.Count];
|
|
for (int i = 0; i < asmPrinterTooling.Count; i++)
|
|
{
|
|
itacPrinterTooling[i] = PrinterToolingMapper.get(asmPrinterTooling[i]);
|
|
}
|
|
return itacPrinterTooling;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static PrinterTooling[] getArray(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterTooling[] asmPrinterTooling)
|
|
{
|
|
if (asmPrinterTooling == null) { return null; }
|
|
PrinterTooling[] itacPrinterTooling = new PrinterTooling[asmPrinterTooling.Length];
|
|
for (int i = 0; i < asmPrinterTooling.Length; i++)
|
|
{
|
|
itacPrinterTooling[i] = PrinterToolingMapper.get(asmPrinterTooling[i]);
|
|
}
|
|
return itacPrinterTooling;
|
|
}
|
|
}
|
|
}
|