Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Documents / TextTreeRootTextBlock.cs / 1 / TextTreeRootTextBlock.cs
//---------------------------------------------------------------------------- // // File: TextTreeRootTextBlock.cs // // Description: The root node of a TextBlock splay tree. // //--------------------------------------------------------------------------- using System; using MS.Internal; using System.Collections; namespace System.Windows.Documents { // The root node of a TextBlock splay tree. internal class TextTreeRootTextBlock : SplayTreeNode { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors // Creates a TextTreeRootTextBlock instance. internal TextTreeRootTextBlock() { TextTreeTextBlock block; // Allocate an initial block with just two characters -- one for // each edge of the root node. The block will grow when/if // additional content is added. block = new TextTreeTextBlock(2); block.InsertAtNode(this, ElementEdge.AfterStart); } #endregion Constructors //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- #region Public Methods #if DEBUG // Debug-only ToString override. public override string ToString() { return ("RootTextBlock Id=" + this.DebugId); } #endif // DEBUG #endregion Public Methods //------------------------------------------------------ // // Internal Properties // //------------------------------------------------------ #region Internal Properties // The root node never has a parent node. internal override SplayTreeNode ParentNode { get { return null; } set { Invariant.Assert(false, "Can't set ParentNode on TextBlock root!"); } } // Root node of a contained tree, if any. internal override SplayTreeNode ContainedNode { get { return _containedNode; } set { _containedNode = (TextTreeTextBlock)value; } } // The root node never has sibling nodes, so the LeftSymbolCount is a // constant zero. internal override int LeftSymbolCount { get { return 0; } set { Invariant.Assert(false, "TextContainer root is never a sibling!"); } } // Count of unicode chars of all siblings preceding this node. // This property is only used by TextTreeNodes. internal override int LeftCharCount { get { return 0; } set { Invariant.Assert(value == 0); } } // The root node never has siblings, so it never has child nodes. internal override SplayTreeNode LeftChildNode { get { return null; } set { Invariant.Assert(false, "TextBlock root never has sibling nodes!"); } } // The root node never has siblings, so it never has child nodes. internal override SplayTreeNode RightChildNode { get { return null; } set { Invariant.Assert(false, "TextBlock root never has sibling nodes!"); } } // The tree generation. Not used for TextTreeRootTextBlock. internal override uint Generation { get { return 0; } set { Invariant.Assert(false, "TextTreeRootTextBlock does not track Generation!"); } } // Cached symbol offset. The root node is always at offset zero. internal override int SymbolOffsetCache { get { return 0; } set { Invariant.Assert(false, "TextTreeRootTextBlock does not track SymbolOffsetCache!"); } } // Not used for TextTreeRootTextBlock. internal override int SymbolCount { get { return -1; } set { Invariant.Assert(false, "TextTreeRootTextBlock does not track symbol count!"); } } // Count of unicode chars covered by this node and any contained nodes. // This property is only used by TextTreeNodes. internal override int IMECharCount { get { return 0; } set { Invariant.Assert(value == 0); } } #endregion Internal Properties //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ #region Private Fields // Root node of a contained tree, if any. private TextTreeTextBlock _containedNode; #endregion Private Fields } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // File: TextTreeRootTextBlock.cs // // Description: The root node of a TextBlock splay tree. // //--------------------------------------------------------------------------- using System; using MS.Internal; using System.Collections; namespace System.Windows.Documents { // The root node of a TextBlock splay tree. internal class TextTreeRootTextBlock : SplayTreeNode { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors // Creates a TextTreeRootTextBlock instance. internal TextTreeRootTextBlock() { TextTreeTextBlock block; // Allocate an initial block with just two characters -- one for // each edge of the root node. The block will grow when/if // additional content is added. block = new TextTreeTextBlock(2); block.InsertAtNode(this, ElementEdge.AfterStart); } #endregion Constructors //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- #region Public Methods #if DEBUG // Debug-only ToString override. public override string ToString() { return ("RootTextBlock Id=" + this.DebugId); } #endif // DEBUG #endregion Public Methods //------------------------------------------------------ // // Internal Properties // //------------------------------------------------------ #region Internal Properties // The root node never has a parent node. internal override SplayTreeNode ParentNode { get { return null; } set { Invariant.Assert(false, "Can't set ParentNode on TextBlock root!"); } } // Root node of a contained tree, if any. internal override SplayTreeNode ContainedNode { get { return _containedNode; } set { _containedNode = (TextTreeTextBlock)value; } } // The root node never has sibling nodes, so the LeftSymbolCount is a // constant zero. internal override int LeftSymbolCount { get { return 0; } set { Invariant.Assert(false, "TextContainer root is never a sibling!"); } } // Count of unicode chars of all siblings preceding this node. // This property is only used by TextTreeNodes. internal override int LeftCharCount { get { return 0; } set { Invariant.Assert(value == 0); } } // The root node never has siblings, so it never has child nodes. internal override SplayTreeNode LeftChildNode { get { return null; } set { Invariant.Assert(false, "TextBlock root never has sibling nodes!"); } } // The root node never has siblings, so it never has child nodes. internal override SplayTreeNode RightChildNode { get { return null; } set { Invariant.Assert(false, "TextBlock root never has sibling nodes!"); } } // The tree generation. Not used for TextTreeRootTextBlock. internal override uint Generation { get { return 0; } set { Invariant.Assert(false, "TextTreeRootTextBlock does not track Generation!"); } } // Cached symbol offset. The root node is always at offset zero. internal override int SymbolOffsetCache { get { return 0; } set { Invariant.Assert(false, "TextTreeRootTextBlock does not track SymbolOffsetCache!"); } } // Not used for TextTreeRootTextBlock. internal override int SymbolCount { get { return -1; } set { Invariant.Assert(false, "TextTreeRootTextBlock does not track symbol count!"); } } // Count of unicode chars covered by this node and any contained nodes. // This property is only used by TextTreeNodes. internal override int IMECharCount { get { return 0; } set { Invariant.Assert(value == 0); } } #endregion Internal Properties //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ #region Private Fields // Root node of a contained tree, if any. private TextTreeTextBlock _containedNode; #endregion Private Fields } } // 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](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RtfNavigator.cs
- UpdatePanel.cs
- TextEditorMouse.cs
- __Filters.cs
- InfoCardHelper.cs
- HttpListenerException.cs
- TextElementCollection.cs
- SQLInt16.cs
- AxisAngleRotation3D.cs
- GeometryGroup.cs
- WorkflowOperationBehavior.cs
- AttributeEmitter.cs
- SerializationHelper.cs
- NumericUpDownAcceleration.cs
- DocumentSchemaValidator.cs
- XPathScanner.cs
- Utility.cs
- COM2TypeInfoProcessor.cs
- DbSetClause.cs
- WebBrowserUriTypeConverter.cs
- LayoutDump.cs
- EventLogPermissionAttribute.cs
- IssuedSecurityTokenParameters.cs
- RequestResizeEvent.cs
- UpdateCommand.cs
- _SingleItemRequestCache.cs
- Substitution.cs
- Matrix.cs
- ExeContext.cs
- XPathNodeIterator.cs
- ContentDisposition.cs
- WindowsTokenRoleProvider.cs
- XmlHierarchicalDataSourceView.cs
- SqlBuffer.cs
- HybridObjectCache.cs
- BitSet.cs
- CustomAttributeBuilder.cs
- ComAdminInterfaces.cs
- SafeThemeHandle.cs
- ExpressionBindings.cs
- LocalizationParserHooks.cs
- DbTransaction.cs
- X509CertificateCollection.cs
- BufferedWebEventProvider.cs
- PeerPresenceInfo.cs
- ActivationServices.cs
- TextRangeAdaptor.cs
- LayoutEvent.cs
- SqlCrossApplyToCrossJoin.cs
- PrintDocument.cs
- WorkflowItemsPresenter.cs
- DataGridLinkButton.cs
- RenamedEventArgs.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- ClientSponsor.cs
- HwndSourceKeyboardInputSite.cs
- _NestedMultipleAsyncResult.cs
- ThousandthOfEmRealDoubles.cs
- StringDictionaryEditor.cs
- UpdateRecord.cs
- _SingleItemRequestCache.cs
- BadImageFormatException.cs
- EntityModelBuildProvider.cs
- ZipArchive.cs
- FlowDocumentPage.cs
- SHA384.cs
- Filter.cs
- ApplicationHost.cs
- RepeaterItemCollection.cs
- UIElementCollection.cs
- BamlLocalizabilityResolver.cs
- Button.cs
- _emptywebproxy.cs
- IsolationInterop.cs
- AttachedAnnotationChangedEventArgs.cs
- XNameConverter.cs
- ThreadPool.cs
- TypedDatasetGenerator.cs
- FieldNameLookup.cs
- HMACMD5.cs
- ImageMap.cs
- XD.cs
- MemberCollection.cs
- RoutedEventValueSerializer.cs
- StorageModelBuildProvider.cs
- ComboBox.cs
- ParameterElement.cs
- CharAnimationUsingKeyFrames.cs
- XPathCompileException.cs
- PersonalizationProviderCollection.cs
- HotSpot.cs
- FtpRequestCacheValidator.cs
- PropertyEntry.cs
- PrinterResolution.cs
- And.cs
- RelatedEnd.cs
- GridItemPattern.cs
- ConfigurationConverterBase.cs
- QueryOutputWriterV1.cs
- SocketStream.cs