Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BindingNavigator.cs
- ExpressionBuilder.cs
- MSAANativeProvider.cs
- ColorContextHelper.cs
- BrowserCapabilitiesCompiler.cs
- StringOutput.cs
- StoreContentChangedEventArgs.cs
- COM2ExtendedUITypeEditor.cs
- ContextInformation.cs
- WindowShowOrOpenTracker.cs
- FlowDocumentReader.cs
- PublisherMembershipCondition.cs
- InteropAutomationProvider.cs
- AppSettingsExpressionBuilder.cs
- DataColumnMapping.cs
- DiscoveryServerProtocol.cs
- RestHandler.cs
- CompiledRegexRunner.cs
- MasterPage.cs
- MissingMemberException.cs
- SequentialUshortCollection.cs
- Converter.cs
- ComponentSerializationService.cs
- SafeHGlobalHandleCritical.cs
- BaseAsyncResult.cs
- _NestedMultipleAsyncResult.cs
- MarkupObject.cs
- ImmutableCommunicationTimeouts.cs
- NonSerializedAttribute.cs
- ExpandSegmentCollection.cs
- HMACSHA512.cs
- ApplicationSecurityManager.cs
- ProxyHelper.cs
- DataGridViewCellStyleConverter.cs
- RulePatternOps.cs
- NumberSubstitution.cs
- CreateUserWizardAutoFormat.cs
- EnumMemberAttribute.cs
- StoryFragments.cs
- DoubleCollection.cs
- XslTransform.cs
- DesignTimeHTMLTextWriter.cs
- TransformGroup.cs
- DataGridViewTopRowAccessibleObject.cs
- BatchWriter.cs
- CaseStatement.cs
- ExpressionValueEditor.cs
- FindCriteriaApril2005.cs
- EntryPointNotFoundException.cs
- Vector3DValueSerializer.cs
- SqlResolver.cs
- PeerApplication.cs
- FileInfo.cs
- AmbientLight.cs
- BitmapFrameEncode.cs
- _ScatterGatherBuffers.cs
- XmlChoiceIdentifierAttribute.cs
- ToolStripScrollButton.cs
- ConfigUtil.cs
- NativeMethods.cs
- CompoundFileStorageReference.cs
- PackageRelationshipCollection.cs
- ProjectionCamera.cs
- SocketCache.cs
- FlowSwitchDesigner.xaml.cs
- LayoutEngine.cs
- ThicknessAnimation.cs
- InstanceLockQueryResult.cs
- FamilyTypefaceCollection.cs
- RuleSetCollection.cs
- TemplateControlParser.cs
- MediaTimeline.cs
- ConfigXmlWhitespace.cs
- OrderPreservingPipeliningMergeHelper.cs
- HttpInputStream.cs
- PreviewControlDesigner.cs
- ConfigXmlText.cs
- QueryInterceptorAttribute.cs
- Parser.cs
- RelationshipEndMember.cs
- TextElementEnumerator.cs
- ImageFormat.cs
- StringValueSerializer.cs
- SoapFault.cs
- WebPartEditorOkVerb.cs
- ToolStripScrollButton.cs
- TabItem.cs
- OleDbParameterCollection.cs
- CodeTypeOfExpression.cs
- StatusBarItemAutomationPeer.cs
- DataBoundControlHelper.cs
- XmlReflectionImporter.cs
- FamilyCollection.cs
- AsyncStreamReader.cs
- DataListItemCollection.cs
- TextChange.cs
- EditorZoneBase.cs
- RegionInfo.cs
- Boolean.cs
- PersonalizationStateInfo.cs