コード例 #1
0
ファイル: Form_Main.cs プロジェクト: mik-claire/Twitter_Test
        private List<DirectMessage> getTalkDm(DirectMessage dm)
        {
            User talkingUser = dm.Sender;

            var dmRecieved = tokens.DirectMessages.Received(count => 200).Where(x => x.Sender.ScreenName == talkingUser.ScreenName);
            var dmSent = tokens.DirectMessages.Sent(count => 200).Where(x => x.Recipient.ScreenName == talkingUser.ScreenName);

            List<DirectMessage> dmList = new List<DirectMessage>();
            dmList.AddRange(dmRecieved);
            dmList.AddRange(dmSent);

            var query = dmList.OrderByDescending(s => s.CreatedAt);
            List<DirectMessage> talk = query.ToList<DirectMessage>();

            return talk;
        }