107 lines
4.4 KiB
C#
107 lines
4.4 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:10:38
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace com.itac.oib.client
|
|
{
|
|
// source: assembly 2.3.0.2
|
|
// source: assembly ASM.AS.OIB.Client
|
|
public class OibServiceMapper
|
|
{
|
|
// used for itac->asm: True
|
|
// used for asm->itac: True
|
|
|
|
// maps iTAC namespace conform type to ASM namespace type
|
|
public static Asm.As.Oib.Client.OibService get(OibService itacOibService)
|
|
{
|
|
if (itacOibService == null) { return null; }
|
|
Asm.As.Oib.Client.OibService asmOibService = new Asm.As.Oib.Client.OibService(Asm.As.Oib.SiplacePro.Proxy.Business.Types.ResourceIDs.AttachableheadtypeCp_20);
|
|
mapItac2Asm(asmOibService, itacOibService);
|
|
return asmOibService;
|
|
}
|
|
|
|
public static void mapItac2Asm(Asm.As.Oib.Client.OibService asmOibService, OibService itacOibService)
|
|
{
|
|
// property IsDisposed is readonly(no set method)
|
|
// property ComputerName is readonly(no set method)
|
|
// property OibServiceName is readonly(no set method)
|
|
// property OibServiceDisplayName is readonly(no set method)
|
|
// property OibServiceComputerName is readonly(no set method)
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static Asm.As.Oib.Client.OibService[] get(OibService[] itacOibService)
|
|
{
|
|
if (itacOibService == null) { return null; }
|
|
Asm.As.Oib.Client.OibService[] asmOibService = new Asm.As.Oib.Client.OibService[itacOibService.Length];
|
|
for (int i = 0; i < itacOibService.Length; i++)
|
|
{
|
|
// to itac array
|
|
asmOibService[i] = OibServiceMapper.get(itacOibService[i]);
|
|
}
|
|
return asmOibService;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<Asm.As.Oib.Client.OibService> getList(OibService[] asmOibService)
|
|
{
|
|
if (asmOibService == null) { return null; }
|
|
List<Asm.As.Oib.Client.OibService> itacOibService = new List<Asm.As.Oib.Client.OibService>();
|
|
for (int i = 0; i < asmOibService.Length; i++)
|
|
{
|
|
itacOibService.Add(OibServiceMapper.get(asmOibService[i]));
|
|
}
|
|
return itacOibService;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static OibService get(Asm.As.Oib.Client.OibService asmOibService)
|
|
{
|
|
if (asmOibService == null) { return null; }
|
|
OibService itacOibService = new OibService();
|
|
mapAsm2Itac(asmOibService, itacOibService);
|
|
return itacOibService;
|
|
}
|
|
|
|
public static void mapAsm2Itac(Asm.As.Oib.Client.OibService asmOibService, OibService itacOibService)
|
|
{
|
|
itacOibService.IsDisposed = asmOibService.IsDisposed;
|
|
itacOibService.ComputerName = asmOibService.ComputerName;
|
|
itacOibService.OibServiceName = asmOibService.OibServiceName;
|
|
itacOibService.OibServiceDisplayName = asmOibService.OibServiceDisplayName;
|
|
itacOibService.OibServiceComputerName = asmOibService.OibServiceComputerName;
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static OibService[] getArray(IList<Asm.As.Oib.Client.OibService> asmOibService)
|
|
{
|
|
if (asmOibService == null) { return null; }
|
|
OibService[] itacOibService = new OibService[asmOibService.Count];
|
|
for (int i = 0; i < asmOibService.Count; i++)
|
|
{
|
|
itacOibService[i] = OibServiceMapper.get(asmOibService[i]);
|
|
}
|
|
return itacOibService;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static OibService[] getArray(Asm.As.Oib.Client.OibService[] asmOibService)
|
|
{
|
|
if (asmOibService == null) { return null; }
|
|
OibService[] itacOibService = new OibService[asmOibService.Length];
|
|
for (int i = 0; i < asmOibService.Length; i++)
|
|
{
|
|
itacOibService[i] = OibServiceMapper.get(asmOibService[i]);
|
|
}
|
|
return itacOibService;
|
|
}
|
|
}
|
|
}
|