public void MethodInitialize()
        {
        
            ComMetasysClientFactory = new ComMetasysClientFactory();
            LClient = ComMetasysClientFactory.GetLegacyClient("hostname");
            httpTest = new HttpTest();

            Mapper = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap<AccessToken, IComAccessToken>();
                cfg.CreateMap<Variant, IComVariant>();
                cfg.CreateMap<VariantMultiple, IComVariantMultiple>();
                cfg.CreateMap<MetasysObject, IComMetasysObject>().ForMember(dest => dest.Children, opt => opt.MapFrom(src => Mapper.Map<IComMetasysObject[]>(src.Children)));
                cfg.CreateMap<VariantMultiple, IComVariantMultiple>()
                    .ForMember(dest => dest.Values, opt => opt.MapFrom(src => Mapper.Map<IComVariant[]>(src.Values)));
                cfg.CreateMap<Command, IComCommand>();
                cfg.CreateMap<MetasysObjectType, IComMetasysObjectType>();
            }).CreateMapper();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var log = new LogInitializer(typeof(Program));

            try
            {
                var comMetasysClientFactory = new ComMetasysClientFactory();
                Console.WriteLine("Please enter your credentials." +
                                  "\nRefer to the metasys-server/basic-services-dotnet README if you need help getting started.");
                Console.Write("Enter the Hostname:");
                var hostName = Console.ReadLine();
                Console.Write("Enter the Username:"******"Enter the Password:"******"Logging In.....");
                Console.WriteLine("Login Successfull...");
                #endregion

                bool showMenu = true;
                while (showMenu)
                {
                    showMenu = MainMenu(legacyClient);
                }
            }
            catch (Exception exception)
            {
                log.Logger.Error(string.Format("An error occured while login - {0}", exception.Message));
                Console.WriteLine("\n \nAn Error occurred. Press Enter to return to exit");
            }
            Console.ReadLine();
        }