public virtual void UpdateListener(object sender, StreamUpdateEventArgs e) { var status = e.Status; _Contents.AddFirst(Toot.fromMastonetStatus(status)); Changed("Contents"); }
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"); }
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)); }
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); }
/* 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); }
private void ContextMenu_Debug_Click(object sender, RoutedEventArgs e) { Toot t = (Toot)this.DataContext; System.Windows.Clipboard.SetText(t.Content, TextDataFormat.UnicodeText); }