public override void Draw(CanvasAnimatedDrawEventArgs args) { base.Draw(args); // strings float fCurrentY = StringsPosition.Y; for (int i = 0; i < Strings.Count - 1; i++) { RichString str = Strings[i].ToRichString(); str.Draw(args, new Vector2(StringsPosition.X, fCurrentY), StringsFont); fCurrentY += (float)StringsTextLayout.LayoutBounds.Height; } // bar below strings args.DrawingSession.DrawLine(BarUnderStringsLeft, BarUnderStringsRight, Colors.White); if (Strings.Count > 0) { RichString str = Strings[Strings.Count - 1].ToRichString(); // prominent string str.Draw(args, ProminentStringPosition, ProminentStringFont); // debug //CanvasTextLayout layout = new CanvasTextLayout(args.DrawingSession.Device, str.String, ProminentStringFont, 0, 0); //Statics.MaxStringWidth = ((int)layout.LayoutBounds.Width > Statics.MaxStringWidth) ? (int)layout.LayoutBounds.Width : Statics.MaxStringWidth; } }
public void Add(RichString str) { if (str == null) { return; } Strings.Add(str); if (Strings.Count > MaxStrings) { Strings.RemoveAt(0); } }
public bool Remove(RichString str) { return(Strings.Remove(str)); }
public bool Remove(RichString str) { return Strings.Remove(str); }