예제 #1
0
        public static void Send(Pager model)
        {
            if (model.To == null || string.IsNullOrWhiteSpace(model.Message)) return;

            using (model.Modifier(x => x.Message))
            {

                Message message = new Message
                {
                    CreatedTime   = DateTime.Now,
                    From          = From,
                    To            = model.To,
                    ContentAsText = model.Message
                };

                model.Message = string.Empty;
                model.History.Add(message)  ;

                m_history.Add(message);

                using (var factory = new ChannelFactory<IMessageHost>(new BasicHttpBinding(), message.To.Uri))
                {
                     factory.Open();
             					 factory.CreateChannel().Send(new Request<Message>(message));
                }

            }
        }
예제 #2
0
        public static void Message(Message model)
        {
            model.Addresses = m_addressBook.SelectMany(x => x.Addresses.Select(y=>new Address{Name = y.Name , Uri = y.Uri})  ).ToArray();

            View("messageview", new ViewModel<Message>
            {
                 Model = model ,
                 Close = Route(Back)
            });
        }