示例#1
0
        public virtual void UpdateListener(object sender, StreamUpdateEventArgs e)
        {
            var status = e.Status;

            _Contents.AddFirst(Toot.fromMastonetStatus(status));
            Changed("Contents");
        }
示例#2
0
        public override async Task GetTimelineAsync(Client client)
        {
            var res = await client.GetLocalTimeLine();

            foreach (var item in res.Reverse <Status>())
            {
                _Contents.AddFirst(Toot.fromMastonetStatus(item));
            }
            Changed("Contents");
        }
示例#3
0
        public object Convert(object _value, Type targetType, object parameter, CultureInfo culture)
        {
            if (_value == null || !(_value is Toot))
            {
                return(DefaultContent);
            }
            Toot   toot  = (Toot)_value;
            string value = toot.Content;

            return(Converter.Mathtodon.Process(value, toot));
        }
示例#4
0
        public static Toot fromMastonetStatus(Status status)
        {
            Toot o = new Toot();

            o._status  = status;
            o._content = status.Content;
            o._date    = status.CreatedAt;
            o._author  = status.Account;
            //o.CompileFlowDocument();
            //Debug.WriteLine(o._content);
            return(o);
        }
示例#5
0
/*		public void CompileFlowDocument() {
 *                      if (this._document != null) {
 *                              var res = Converter.Mathtodon.Process(Content, this);
 *                              this._document = res;
 *                              Changed("Document");
 *                      }
 *              }
 */

        public static List <Toot> GetMockToots()
        {
            int         n   = 3;
            List <Toot> res = new List <Toot>();

            for (int i = 0; i < n; i++)
            {
                Toot o = new Toot();
                o._content = "lorem ipsum";
                o._author  = new Account();
                o._date    = DateTime.Now;
                //o.CompileFlowDocument();
                res.Add(o);
            }
            return(res);
        }
示例#6
0
        private void ContextMenu_Debug_Click(object sender, RoutedEventArgs e)
        {
            Toot t = (Toot)this.DataContext;

            System.Windows.Clipboard.SetText(t.Content, TextDataFormat.UnicodeText);
        }