Files
2025-06-06 09:15:13 +02:00

105 lines
4.3 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 06.11.2018 11:07:38
using System;
using System.Collections.Generic;
namespace com.itac.oib.siplacesetupcenter.contracts.data
{
// source: assembly 5.1.0.84
// source: assembly ASM.AS.OIB.SIPLACESetupCenter.Contracts
public class LockInfoMapper
{
// used for itac->asm: True
// used for asm->itac: True
// maps iTAC namespace conform type to ASM namespace type
public static Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.LockInfo get(LockInfo itacLockInfo)
{
if (itacLockInfo == null) { return null; }
Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.LockInfo asmLockInfo = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.LockInfo();
mapItac2Asm(asmLockInfo, itacLockInfo);
return asmLockInfo;
}
public static void mapItac2Asm(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.LockInfo asmLockInfo, LockInfo itacLockInfo)
{
asmLockInfo.Source = itacLockInfo.Source;
asmLockInfo.Reason = itacLockInfo.Reason;
asmLockInfo.Date = itacLockInfo.Date;
asmLockInfo.Message = itacLockInfo.Message;
}
// maps iTAC namespace conform array to ASM namespace array
public static Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.LockInfo[] get(LockInfo[] itacLockInfo)
{
if (itacLockInfo == null) { return null; }
Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.LockInfo[] asmLockInfo = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.LockInfo[itacLockInfo.Length];
for (int i = 0; i < itacLockInfo.Length; i++)
{
// to itac array
asmLockInfo[i] = LockInfoMapper.get(itacLockInfo[i]);
}
return asmLockInfo;
}
// maps iTAC namespace conform array to ASM namespace list
public static List<Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.LockInfo> getList(LockInfo[] asmLockInfo)
{
if (asmLockInfo == null) { return null; }
List<Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.LockInfo> itacLockInfo = new List<Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.LockInfo>();
for (int i = 0; i < asmLockInfo.Length; i++)
{
itacLockInfo.Add(LockInfoMapper.get(asmLockInfo[i]));
}
return itacLockInfo;
}
// map type from ASM namespace to iTAC namespace
public static LockInfo get(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.LockInfo asmLockInfo)
{
if (asmLockInfo == null) { return null; }
LockInfo itacLockInfo = new LockInfo();
mapAsm2Itac(asmLockInfo, itacLockInfo);
return itacLockInfo;
}
public static void mapAsm2Itac(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.LockInfo asmLockInfo, LockInfo itacLockInfo)
{
itacLockInfo.Source = asmLockInfo.Source;
itacLockInfo.Reason = asmLockInfo.Reason;
itacLockInfo.Date = asmLockInfo.Date;
itacLockInfo.Message = asmLockInfo.Message;
}
// maps ASM namespace conform list to iTAC namespace array
public static LockInfo[] getArray(IList<Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.LockInfo> asmLockInfo)
{
if (asmLockInfo == null) { return null; }
LockInfo[] itacLockInfo = new LockInfo[asmLockInfo.Count];
for (int i = 0; i < asmLockInfo.Count; i++)
{
itacLockInfo[i] = LockInfoMapper.get(asmLockInfo[i]);
}
return itacLockInfo;
}
// maps ASM namespace conform array to iTAC namespace array
public static LockInfo[] getArray(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.LockInfo[] asmLockInfo)
{
if (asmLockInfo == null) { return null; }
LockInfo[] itacLockInfo = new LockInfo[asmLockInfo.Length];
for (int i = 0; i < asmLockInfo.Length; i++)
{
itacLockInfo[i] = LockInfoMapper.get(asmLockInfo[i]);
}
return itacLockInfo;
}
}
}