LineBreak.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Documents / LineBreak.cs / 1305600 / LineBreak.cs

                            //---------------------------------------------------------------------------- 
//
// Copyright (C) Microsoft Corporation.  All rights reserved.
//
// Description: LineBreak element. 
//
// History: 
//  07/22/2002 : MikeOrr - Created. 
//  06/26/2003 : ZhenbinX - Ported to /Rewrote for WCP tree
//  10/28/2004 : [....] - ContentElements refactoring. 
//
//---------------------------------------------------------------------------

using System.Windows.Markup; // TrimSurrondingWhitespace 

namespace System.Windows.Documents 
{ 
    /// 
    /// LineBreak element that forces a line breaking. 
    /// 
    [TrimSurroundingWhitespace]
    public class LineBreak : Inline
    { 
        /// 
        /// Creates a new LineBreak instance. 
        ///  
        public LineBreak()
        { 
        }

        /// 
        /// Creates a new LineBreak instance. 
        /// 
        ///  
        /// Optional position at which to insert the new LineBreak. May 
        /// be null.
        ///  
        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();
                }
            }
        } 
    }
} 
 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------------------- 
//
// Copyright (C) Microsoft Corporation.  All rights reserved.
//
// Description: LineBreak element. 
//
// History: 
//  07/22/2002 : MikeOrr - Created. 
//  06/26/2003 : ZhenbinX - Ported to /Rewrote for WCP tree
//  10/28/2004 : [....] - ContentElements refactoring. 
//
//---------------------------------------------------------------------------

using System.Windows.Markup; // TrimSurrondingWhitespace 

namespace System.Windows.Documents 
{ 
    /// 
    /// LineBreak element that forces a line breaking. 
    /// 
    [TrimSurroundingWhitespace]
    public class LineBreak : Inline
    { 
        /// 
        /// Creates a new LineBreak instance. 
        ///  
        public LineBreak()
        { 
        }

        /// 
        /// Creates a new LineBreak instance. 
        /// 
        ///  
        /// Optional position at which to insert the new LineBreak. May 
        /// be null.
        ///  
        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();
                }
            }
        } 
    }
} 
 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK