using EgwProxy.MagMan; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DemoApp { internal class Program { static async Task Main(string[] args) { string testToken = "91f4fec6-7e9c-4130-9df2-702d729ccdd3"; string sep = "--------------------------------------------"; Console.WriteLine(sep); Console.WriteLine("- MagMan REST Demo App"); Console.WriteLine(sep); Console.WriteLine(); string answ = ""; DataSyncro commLib = new DataSyncro(testToken); Console.WriteLine("Premere ENT per check ping"); answ = Console.ReadLine(); bool servOk = commLib.CheckRemote(); string esito = servOk ? "OK" : "KO"; Console.WriteLine($"Esito controllo server: {esito}"); Console.WriteLine("Premere un tasto per lettura archivio materiali"); answ = Console.ReadLine(); var matList = await commLib.GetMaterials(); if (matList != null) { foreach (var item in matList) { Console.WriteLine(sep); Console.WriteLine($"Mat Code: {item.MatExtCode}"); Console.WriteLine($"Dtmx Code: {item.MatDtmx}"); Console.WriteLine($"descript: {item.MatDesc}"); Console.WriteLine($"Dimensions W x T x L: {item.WMm:N3} x {item.TMm:N3} x {item.LMm:N3}"); Console.WriteLine(sep); Console.WriteLine(); } } answ = Console.ReadLine(); } } }