本文整理汇总了C#中System.Windows.Documents.TextPointer.InsertInline方法的典型用法代码示例。如果您正苦于以下问题:C# TextPointer.InsertInline方法的具体用法?C# TextPointer.InsertInline怎么用?C# TextPointer.InsertInline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Documents.TextPointer
的用法示例。
在下文中一共展示了TextPointer.InsertInline方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AnchoredBlock
//-------------------------------------------------------------------
//
// Constructors
//
//-------------------------------------------------------------------
#region Constructors
/// <summary>
/// Creates a new AnchoredBlock instance.
/// </summary>
/// <param name="block">
/// Optional child of the new AnchoredBlock, may be null.
/// </param>
/// <param name="insertionPosition">
/// Optional position at which to insert the new AnchoredBlock. May
/// be null.
/// </param>
protected AnchoredBlock(Block block, TextPointer insertionPosition)
{
if (insertionPosition != null)
{
insertionPosition.TextContainer.BeginChange();
}
try
{
if (insertionPosition != null)
{
// This will throw InvalidOperationException if schema validity is violated.
insertionPosition.InsertInline(this);
}
if (block != null)
{
this.Blocks.Add(block);
}
}
finally
{
if (insertionPosition != null)
{
insertionPosition.TextContainer.EndChange();
}
}
}
示例2: Span
/// <summary>
/// Creates a new Span instance.
/// </summary>
/// <param name="childInline">
/// Optional child Inline for the new Span. May be null.
/// </param>
/// <param name="insertionPosition">
/// Optional position at which to insert the new Span. May be null.
/// </param>
public Span(Inline childInline, TextPointer insertionPosition)
{
if (insertionPosition != null)
{
insertionPosition.TextContainer.BeginChange();
}
try
{
if (insertionPosition != null)
{
// This will throw InvalidOperationException if schema validity is violated.
insertionPosition.InsertInline(this);
}
if (childInline != null)
{
this.Inlines.Add(childInline);
}
}
finally
{
if (insertionPosition != null)
{
insertionPosition.TextContainer.EndChange();
}
}
}
示例3: Run
/// <summary>
/// Creates a new Run instance.
/// </summary>
/// <param name="text">
/// Optional text content. May be null.
/// </param>
/// <param name="insertionPosition">
/// Optional position at which to insert the new Run. May
/// be null.
/// </param>
public Run(string text, TextPointer insertionPosition)
{
if (insertionPosition != null)
{
insertionPosition.TextContainer.BeginChange();
}
try
{
if (insertionPosition != null)
{
// This will throw InvalidOperationException if schema validity is violated.
insertionPosition.InsertInline(this);
}
if (text != null)
{
// No need to duplicate the string data in TextProperty here. TextContainer will
// set the property to a deferred reference.
this.ContentStart.InsertTextInRun(text);
}
}
finally
{
if (insertionPosition != null)
{
insertionPosition.TextContainer.EndChange();
}
}
}
示例4: LineBreak
/// <summary>
/// Creates a new LineBreak instance.
/// </summary>
/// <param name="insertionPosition">
/// Optional position at which to insert the new LineBreak. May
/// be null.
/// </param>
public LineBreak(TextPointer insertionPosition)
{
if (insertionPosition != null)
{
insertionPosition.TextContainer.BeginChange();
}
try
{
if (insertionPosition != null)
{
// This will throw InvalidOperationException if schema validity is violated.
insertionPosition.InsertInline(this);
}
}
finally
{
if (insertionPosition != null)
{
insertionPosition.TextContainer.EndChange();
}
}
}
示例5: InlineUIContainer
/// <summary>
/// Creates a new InlineUIContainer instance.
/// </summary>
/// <param name="childUIElement">
/// Optional child of the new InlineUIContainer, may be null.
/// </param>
/// <param name="insertionPosition">
/// Optional position at which to insert the new InlineUIContainer. May
/// be null.
/// </param>
public InlineUIContainer(UIElement childUIElement, TextPointer insertionPosition)
{
if (insertionPosition != null)
{
insertionPosition.TextContainer.BeginChange();
}
try
{
if (insertionPosition != null)
{
// This will throw InvalidOperationException if schema validity is violated.
insertionPosition.InsertInline(this);
}
this.Child = childUIElement;
}
finally
{
if (insertionPosition != null)
{
insertionPosition.TextContainer.EndChange();
}
}
}