コード例 #1
0
        public void OnReply(Tweet tweet, string screenName)
        {
            if (tweet == null)
            {
                return;
            }
            if (tweet.IsDirectMessage)
            {
                Compose.ShowDirectMessage(tweet.ScreenName);
            }
            else
            {
                var matches = new Regex(@"(?<=^|(?<=[^a-zA-Z0-9-_\.]))@([A-Za-z]+[A-Za-z0-9_]+)")
                              .Matches(tweet.Text);

                var names = matches
                            .Cast <Match>()
                            .Where(m => m.Groups[1].Value != tweet.ScreenName)
                            .Where(m => m.Groups[1].Value != screenName)
                            .Select(m => "@" + m.Groups[1].Value)
                            .Distinct();

                var replyTos = string.Join(" ", names);
                var message  = string.Format("@{0} {1}{2}", tweet.ScreenName, replyTos, (replyTos.Length > 0) ? " " : "");
                Compose.Show(message, tweet.StatusId);
            }
        }
コード例 #2
0
        private void ReplyButton_Click(object sender, RoutedEventArgs e)
        {
            var Compose = new Compose(_mvm, ExtractEmail(), $"Re: {emailSubject.Text}");

            Compose.Show();
            Close();
        }
コード例 #3
0
        private void Compose_Click(object sender, RoutedEventArgs e)
        {
            var Compose = new Compose(_mvm);

            Compose.Show();
        }