示例#1
0
        public List<SkypeMessage> GetAllMessages(long fromId, SkypeContact contact)
        {
            List<SkypeMessage> messages = new List<SkypeMessage>();
            if (contact == null)
            {
                return messages;
            }
            GetAllChats().Where(chat => chat.DialogPartner == contact.Name).ToList().ForEach(chat =>
            {
                messages.AddRange(GetAllMessages(fromId, chat));
            });

            return messages.OrderBy(m => m.Time).ToList();
        }
示例#2
0
        public List <SkypeMessage> GetAllMessages(long fromId, SkypeContact contact)
        {
            List <SkypeMessage> messages = new List <SkypeMessage>();

            if (contact == null)
            {
                return(messages);
            }
            GetAllChats().Where(chat => chat.DialogPartner == contact.Name).ToList().ForEach(chat =>
            {
                messages.AddRange(GetAllMessages(fromId, chat));
            });

            return(messages.OrderBy(m => m.Time).ToList());
        }
示例#3
0
        public void HTMLMessagesFormatterTest()
        {
            //HtmlMessagesFormatter formatter = new HtmlMessagesFormatter(null);
            //List<SkypeMessage> messages = new List<SkypeMessage>(new[]
            //{
            //    new SkypeMessage()
            //    {
            //        Message = "test'test",
            //        Author = "test"
            //    }
            //});

            //Console.WriteLine(formatter.FormatMessages(messages));
            SkypeDAL dal = new SkypeDAL();

            SkypeDAL.ConnectionString = @"Data Source=C:\Users\user\AppData\Roaming\Skype\victor.hytyk.prl\main.db;Version=3;";
            SkypeContact          nauroskype = dal.GetAllContacts().Find(contact => contact.Name.Contains("nauroskype"));
            HtmlMessagesFormatter formatter  = new HtmlMessagesFormatter(null);
            string f = formatter.FormatMessages(new List <SkypeMessage>(new [] { dal.GetAllMessages(-1, nauroskype).Last() }));

            Console.WriteLine(f);
        }