Exemplo n.º 1
0
        public Toot(StatusClass_new status)
        {
            Width = 400;
            this.InitializeComponent();
            toot = status;
            string acct  = status.account.acct;
            string dname = status.account.display_name;

            UserName.Text = dname + "\n" + acct;
            TootContents.NavigateToString(WebContentHelper.WrapHtml((string)status.content, 350, 400));
            string avatar     = status.account.avatar;
            string reblogged  = status.reblogged;
            string favourited = status.favourited;

            if (reblogged == "1")
            {
                Retoot.Foreground = new SolidColorBrush(Colors.Green);
            }
            if (favourited == "1")
            {
                Favorites.Foreground = new SolidColorBrush(Colors.Yellow);
            }
            if (avatar != null)
            {
                if (avatar[0] == 'h') // HACK!!!
                {
                    UserImage.Source = new BitmapImage(new Uri(avatar));
                }
                else
                {
                    UserImage.Source = new BitmapImage(new Uri("https://" + GetToken.getServerName() + avatar));
                }
            }
        }
Exemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();
            HttpConnectionClass token = null;
            int logged_in             = 1;

            try
            {
                token = new HttpConnectionClass(GetToken.getAuthClass());
            }
            catch
            {
                logged_in = 0;
                LoginWindow window = new LoginWindow();
                window.Show();
            }
            if (logged_in == 1)
            {
                string baseuri  = "https://" + token.auth.server;
                var    tootlist = StatusClass_new.GetTimeline(token);
                for (int i = 0; i < tootlist.Length - 1; i++)
                {
                    Toot toot;
                    toot = new Toot(tootlist[i]);
                    Toots.Items.Insert(0, toot);
                }
            }
        }
Exemplo n.º 3
0
 private void Favorites_Click(object sender, RoutedEventArgs e)
 {
     StatusClass.favourite_toot(toot.id, GetToken.getAuthClass());
     Favorites.Foreground = new SolidColorBrush(Colors.Yellow);
 }
Exemplo n.º 4
0
 private void Retoot_Click(object sender, RoutedEventArgs e)
 {
     StatusClass.boost_toot(toot_id, GetToken.getAuthClass());
     Retoot.Foreground = new SolidColorBrush(Colors.Green);
 }