Ejemplo n.º 1
0
        static void Init()
        {
            //init config
            SendMessageConfig.Init();
            var modems   = AutoMapper.Mapper.Map <IEnumerable <ModemElement>, List <Modem> >(SendMessageConfig.Settings.Modems.Cast <ModemElement>());
            var contacts = AutoMapper.Mapper.Map <IEnumerable <ContactElement>, List <Contact> >(SendMessageConfig.Settings.Contacts.Cast <ContactElement>());

            foreach (Modem modem in modems)
            {
                //add event handler
                modem.OnEvent += OnEvent;
                Modems.Add(modem);
            }
            //add mailboxes
            foreach (Contact contact in contacts)
            {
                Contacts.Add(contact);
            }
        }
Ejemplo n.º 2
0
 internal static void Init()
 {
     SendMessageConfig.settings = ConfigurationManager.GetSection("SendMessage") as SendMessageConfig;
 }