当前位置: 首页>>代码示例>>C#>>正文


C# TextPointer.InsertInline方法代码示例

本文整理汇总了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();
                }
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:45,代码来源:AnchoredBlock.cs

示例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();
                }
            }
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:36,代码来源:Span.cs

示例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(); 
                }
            }
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:39,代码来源:Run.cs

示例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();
         }
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:29,代码来源:LineBreak.cs

示例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();
                }
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:34,代码来源:InlineUIContainer.cs


注:本文中的System.Windows.Documents.TextPointer.InsertInline方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。