示例#1
0
        void Tweet_Loaded(object sender, RoutedEventArgs e)
        {
            RemoveHTML conv = new RemoveHTML();

            if (DataTransfer.DM == null)
            {
                Dispatcher.BeginInvoke(() => MessageBox.Show(Localization.Resources.ErrorLoadingTweet));
                NavigationService.GoBack();
                return;
            }


            status = DataTransfer.DM;

            RelativeDateTimeConverter dc = new RelativeDateTimeConverter();

            CreateText(status);

            Text.UpdateLayout();

            ContentPanel.DataContext = status;

            ViaDate.Margin = new Thickness(ViaDate.Margin.Left, Text.ActualHeight + Text.Margin.Top + 10,
                                           ViaDate.Margin.Right, ViaDate.Margin.Bottom);
            ViaDate.Text = (string)dc.Convert(status.CreatedDate, null, null, null);

            SName.Text = "@" + status.Author.ScreenName;
            ContentPanel.UpdateLayout();
        }
示例#2
0
        private string TweetToText(ITweetable tweet)
        {
            string who, when, text;

            if (tweet is TwitterStatus)
            {
                who = String.Format(Resources.NewMention, tweet.AuthorName);
            }
            else
            {
                who = String.Format(Resources.NewMessage, tweet.AuthorName);
            }

            when = new RelativeDateTimeConverter().Convert(tweet.CreatedDate, null, null, null) as string;

            text = tweet.CleanText;

            return(String.Format("{0}, {1} : {2}", who, when, text));
        }
示例#3
0
        void Tweet_Loaded(object sender, RoutedEventArgs e)
        {
            RemoveHTML conv = new RemoveHTML();

            if (DataTransfer.DM == null)
            {
                Dispatcher.BeginInvoke(() => MessageBox.Show(Localization.Resources.ErrorLoadingTweet));
                NavigationService.GoBack();
                return;
            }

            status = DataTransfer.DM;

            RelativeDateTimeConverter dc = new RelativeDateTimeConverter();

            CreateText(status);

            Text.UpdateLayout();

            ContentPanel.DataContext = status;

            ViaDate.Margin = new Thickness(ViaDate.Margin.Left, Text.ActualHeight + Text.Margin.Top + 10,
                ViaDate.Margin.Right, ViaDate.Margin.Bottom);
            ViaDate.Text = (string)dc.Convert(status.CreatedDate, null, null, null) ;

            SName.Text = "@" + status.Author.ScreenName;
            ContentPanel.UpdateLayout();
        }
示例#4
0
        private string TweetToText(ITweetable tweet)
        {
            string who, when, text;

            if (tweet is TwitterStatus)
                who = String.Format(Resources.NewMention, tweet.AuthorName);
            else
                who = String.Format(Resources.NewMessage, tweet.AuthorName);

            when = new RelativeDateTimeConverter().Convert(tweet.CreatedDate, null, null, null) as string;

            text = tweet.CleanText;

            return String.Format("{0}, {1} : {2}", who, when, text);
        }