117 lines
5.6 KiB
C#
117 lines
5.6 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 23.11.2018 08:02:34
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data;
|
|
|
|
namespace com.itac.oib.siplacesetupcenter.contracts.data
|
|
{
|
|
// source: assembly 3.2.0.152
|
|
// source: assembly ASM.AS.OIB.SIPLACESetupCenter.Contracts
|
|
public class MachineSetupMapper
|
|
{
|
|
// 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._2008._05.SetupCenter.Contracts.Data.MachineSetup get(MachineSetup itacMachineSetup)
|
|
{
|
|
if (itacMachineSetup == null) { return null; }
|
|
www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.MachineSetup asmMachineSetup = new www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.MachineSetup();
|
|
mapItac2Asm(asmMachineSetup, itacMachineSetup);
|
|
return asmMachineSetup;
|
|
}
|
|
|
|
public static void mapItac2Asm(www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.MachineSetup asmMachineSetup, MachineSetup itacMachineSetup)
|
|
{
|
|
// complex property MachineLocator, isArray:False, isGeneric:False
|
|
asmMachineSetup.MachineLocator = com.itac.oib.siplacesetupcenter.contracts.data.MachineLocatorMapper.get( itacMachineSetup.MachineLocator);
|
|
// complex property Tables, isArray:False, isGeneric:True
|
|
asmMachineSetup.Tables = TableMapper.get(itacMachineSetup.Tables);
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.MachineSetup[] get(MachineSetup[] itacMachineSetup)
|
|
{
|
|
if (itacMachineSetup == null) { return null; }
|
|
www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.MachineSetup[] asmMachineSetup = new www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.MachineSetup[itacMachineSetup.Length];
|
|
for (int i = 0; i < itacMachineSetup.Length; i++)
|
|
{
|
|
// to itac array
|
|
asmMachineSetup[i] = MachineSetupMapper.get(itacMachineSetup[i]);
|
|
}
|
|
return asmMachineSetup;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.MachineSetup> getList(MachineSetup[] asmMachineSetup)
|
|
{
|
|
if (asmMachineSetup == null) { return null; }
|
|
List<www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.MachineSetup> itacMachineSetup = new List<www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.MachineSetup>();
|
|
for (int i = 0; i < asmMachineSetup.Length; i++)
|
|
{
|
|
itacMachineSetup.Add(MachineSetupMapper.get(asmMachineSetup[i]));
|
|
}
|
|
return itacMachineSetup;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static MachineSetup get(www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.MachineSetup asmMachineSetup)
|
|
{
|
|
if (asmMachineSetup == null) { return null; }
|
|
MachineSetup itacMachineSetup = new MachineSetup();
|
|
mapAsm2Itac(asmMachineSetup, itacMachineSetup);
|
|
return itacMachineSetup;
|
|
}
|
|
|
|
public static void mapAsm2Itac(www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.MachineSetup asmMachineSetup, MachineSetup itacMachineSetup)
|
|
{
|
|
itacMachineSetup.MachineLocator = com.itac.oib.siplacesetupcenter.contracts.data.MachineLocatorMapper.get(asmMachineSetup.MachineLocator);
|
|
// complex asm property MachineLocator
|
|
// maps ASM list 2 iTAC array
|
|
itacMachineSetup.Tables = TableMapper.getArray(asmMachineSetup.Tables);
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static MachineSetup[] getArray(IList<www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.MachineSetup> asmMachineSetup)
|
|
{
|
|
if (asmMachineSetup == null) { return null; }
|
|
MachineSetup[] itacMachineSetup = new MachineSetup[asmMachineSetup.Count];
|
|
for (int i = 0; i < asmMachineSetup.Count; i++)
|
|
{
|
|
itacMachineSetup[i] = MachineSetupMapper.get(asmMachineSetup[i]);
|
|
}
|
|
return itacMachineSetup;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static MachineSetup[] getArray(www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.MachineSetup[] asmMachineSetup)
|
|
{
|
|
if (asmMachineSetup == null) { return null; }
|
|
MachineSetup[] itacMachineSetup = new MachineSetup[asmMachineSetup.Length];
|
|
for (int i = 0; i < asmMachineSetup.Length; i++)
|
|
{
|
|
itacMachineSetup[i] = MachineSetupMapper.get(asmMachineSetup[i]);
|
|
}
|
|
return itacMachineSetup;
|
|
}
|
|
|
|
internal static MachineSetup[] getArray(List<www.siplace.com.OIB._2008._05.SetupCenter.Contracts.Data.MachineSetup> asmMachineSetup)
|
|
{
|
|
if (asmMachineSetup == null) { return null; }
|
|
MachineSetup[] itacMachineSetup = new MachineSetup[asmMachineSetup.Count];
|
|
for (int i = 0; i < asmMachineSetup.Count; i++)
|
|
{
|
|
itacMachineSetup[i] = MachineSetupMapper.get(asmMachineSetup[i]);
|
|
}
|
|
return itacMachineSetup;
|
|
}
|
|
}
|
|
}
|