Beispiel #1
0
 /// <summary>
 ///     Writes something using the secondary color
 /// </summary>
 /// <param name="sequence">The sequence.</param>
 /// <param name="text">The text.</param>
 public virtual void WriteSecondary(IInlineSequence sequence, string text)
 {
     sequence.PushColor(ViewModel.Theme.SecondaryTextColor);
     sequence.AppendText(text);
     StringBuilder.Append(text);
     sequence.PopFormatting();
 }
Beispiel #2
0
        public override void GenerateSequence (IInlineSequence sequence)
        {
            if (sequence == null)
                throw new ArgumentNullException(nameof(sequence));

            if (Color != null)
                sequence.PushColor(Color.Value);
            if (Background != null)
                sequence.PushBackground(Background.Value);

            if (Text != null) {
                sequence.AppendText(Text);
            }
            else {
                foreach (InlineElement child in VisualChildren.Cast<InlineElement>())
                    child.GenerateSequence(sequence);
            }

            if (Background != null)
                sequence.PopFormatting();
            if (Color != null)
                sequence.PopFormatting();
        }
Beispiel #3
0
        public override void GenerateSequence(IInlineSequence sequence)
        {
            if (sequence == null)
            {
                throw new ArgumentNullException(nameof(sequence));
            }

            if (Color != null)
            {
                sequence.PushColor(Color.Value);
            }
            if (Background != null)
            {
                sequence.PushBackground(Background.Value);
            }

            if (Text != null)
            {
                sequence.AppendText(Text);
            }
            else
            {
                foreach (InlineElement child in VisualChildren.Cast <InlineElement>())
                {
                    child.GenerateSequence(sequence);
                }
            }

            if (Background != null)
            {
                sequence.PopFormatting();
            }
            if (Color != null)
            {
                sequence.PopFormatting();
            }
        }