126 lines
4.8 KiB
C#
126 lines
4.8 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 14:52:23
|
|
// skip property DictionaryProxy`2, property in exclude list
|
|
// skip property ListProxy`1, property in exclude list
|
|
// skip property ArrayList, property in exclude list
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace com.itac.oib.siplacepro.contracts.data
|
|
{
|
|
// source: assembly 5.1.0.84
|
|
// source: assembly ASM.AS.OIB.SIPLACEPro.Proxy
|
|
public class PrinterMapper
|
|
{
|
|
// 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.Printer get(Printer itacPrinter)
|
|
{
|
|
if (itacPrinter == null) { return null; }
|
|
Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Printer asmPrinter = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Printer(Asm.As.Oib.SiplacePro.Proxy.Business.Types.ResourceIDs.AttachableheadtypeCp_20);
|
|
mapItac2Asm(asmPrinter, itacPrinter);
|
|
return asmPrinter;
|
|
}
|
|
|
|
public static void mapItac2Asm(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Printer asmPrinter, Printer itacPrinter)
|
|
{
|
|
asmPrinter.IPName = itacPrinter.IPName;
|
|
asmPrinter.IPAddress = itacPrinter.IPAddress;
|
|
// skip property DictionaryProxy`2, property in exclude list
|
|
// skip property ListProxy`1, property in exclude list
|
|
asmPrinter.PrinterRecipeDownload = itacPrinter.PrinterRecipeDownload;
|
|
// skip readonly property RecipeDownload
|
|
asmPrinter.IPAddressString = itacPrinter.IPAddressString;
|
|
// skip property ArrayList, property in exclude list
|
|
asmPrinter.SoftwareVersion = itacPrinter.SoftwareVersion;
|
|
// complex property Type, isArray:False, isGeneric:False
|
|
itacPrinter.Type = com.itac.oib.siplacepro.contracts.data.PrinterTypeMapper.get( asmPrinter.Type);
|
|
// 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.Printer[] get(Printer[] itacPrinter)
|
|
{
|
|
if (itacPrinter == null) { return null; }
|
|
Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Printer[] asmPrinter = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Printer[itacPrinter.Length];
|
|
for (int i = 0; i < itacPrinter.Length; i++)
|
|
{
|
|
// to itac array
|
|
asmPrinter[i] = PrinterMapper.get(itacPrinter[i]);
|
|
}
|
|
return asmPrinter;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Printer> getList(Printer[] asmPrinter)
|
|
{
|
|
if (asmPrinter == null) { return null; }
|
|
List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Printer> itacPrinter = new List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Printer>();
|
|
for (int i = 0; i < asmPrinter.Length; i++)
|
|
{
|
|
itacPrinter.Add(PrinterMapper.get(asmPrinter[i]));
|
|
}
|
|
return itacPrinter;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static Printer get(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Printer asmPrinter)
|
|
{
|
|
if (asmPrinter == null) { return null; }
|
|
Printer itacPrinter = new Printer();
|
|
mapAsm2Itac(asmPrinter, itacPrinter);
|
|
return itacPrinter;
|
|
}
|
|
|
|
public static void mapAsm2Itac(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Printer asmPrinter, Printer itacPrinter)
|
|
{
|
|
itacPrinter.IPName = asmPrinter.IPName;
|
|
itacPrinter.IPAddress = asmPrinter.IPAddress;
|
|
// skip property DictionaryProxy`2, property in exclude list
|
|
// skip property ListProxy`1, property in exclude list
|
|
itacPrinter.PrinterRecipeDownload = asmPrinter.PrinterRecipeDownload;
|
|
itacPrinter.RecipeDownload = asmPrinter.RecipeDownload;
|
|
itacPrinter.IPAddressString = asmPrinter.IPAddressString;
|
|
// skip property ArrayList, property in exclude list
|
|
itacPrinter.SoftwareVersion = asmPrinter.SoftwareVersion;
|
|
itacPrinter.Type = com.itac.oib.siplacepro.contracts.data.PrinterTypeMapper.get(asmPrinter.Type);
|
|
// complex asm property Type
|
|
itacPrinter.Name = asmPrinter.Name;
|
|
itacPrinter.FullPath = asmPrinter.FullPath;
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static Printer[] getArray(IList<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Printer> asmPrinter)
|
|
{
|
|
if (asmPrinter == null) { return null; }
|
|
Printer[] itacPrinter = new Printer[asmPrinter.Count];
|
|
for (int i = 0; i < asmPrinter.Count; i++)
|
|
{
|
|
itacPrinter[i] = PrinterMapper.get(asmPrinter[i]);
|
|
}
|
|
return itacPrinter;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static Printer[] getArray(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Printer[] asmPrinter)
|
|
{
|
|
if (asmPrinter == null) { return null; }
|
|
Printer[] itacPrinter = new Printer[asmPrinter.Length];
|
|
for (int i = 0; i < asmPrinter.Length; i++)
|
|
{
|
|
itacPrinter[i] = PrinterMapper.get(asmPrinter[i]);
|
|
}
|
|
return itacPrinter;
|
|
}
|
|
}
|
|
}
|