Ejemplo n.º 1
0
        object TextFlow_UpdateWindow(object obj)
        {
            txtFlow = new TextFlow();
            if (_txtRun)
            {
                txtFlow.TextRuns.Add(tr1);
                txtFlow.TextRuns.Add("1st Text", _font, _color);
                txtFlow.TextRuns.Add(tr1);
            }

            if (_lineCount)
            {
                txtFlow.TextRuns.Add(_longStr, _font, _color);
                txtFlow.TextRuns.Add(TextRun.EndOfLine);
                for (int i = 0; i < count; i++)
                {
                    txtFlow.TextRuns.Add("Text " + i, _font, _color);
                    txtFlow.TextRuns.Add(TextRun.EndOfLine);
                }
            }

            trc = txtFlow.TextRuns;
            txtFlow.ScrollingStyle = _style;
            _getStyle        = txtFlow.ScrollingStyle;
            mainWindow.Child = txtFlow;

            return(obj);
        }
Ejemplo n.º 2
0
		private Paragraph(
			string text,
			Alignment alignment,
			float indentation,
			float leading,
			float spacing,
			float tracking,
			TextRunCollection runs)
		{
			Contract.Requires(text != null);
			Contract.Requires(Check.IsPositive(indentation));
			Contract.Requires(Check.IsPositive(leading));
			Contract.Requires(Check.IsPositive(spacing));
			Contract.Requires(Check.IsPositive(tracking));
			Contract.Requires(runs != null);

			_Text = text;
			_Alignment = alignment;
			_Indentation = indentation;
			_Leading = leading;
			_Spacing = spacing;
			_Tracking = tracking;
			_Runs = runs;
		}