Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / MS / Internal / IO / Packaging / fixedPageContentExtractor.cs / 1 / fixedPageContentExtractor.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // Given a DOM node for a fixed page, enumerates its text content. // // History: // 05/11/2004: JohnLarc: Initial implementation //--------------------------------------------------------------------------- using System; using System.Xml; namespace MS.Internal.IO.Packaging { ////// Implements a sequence of (textContent, precedingDelimiter) pairs for /// a fixed page node. /// internal class FixedPageContentExtractor { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors ////// Initialize a FixedPageContentExtractor from a DOM node. /// internal FixedPageContentExtractor(XmlNode fixedPage) { _fixedPageInfo = new XmlFixedPageInfo(fixedPage); _nextGlyphRun = 0; } #endregion Constructors //------------------------------------------------------ // // Internal Methods // //----------------------------------------------------- #region Internal Methods ////// Return the content of the next glyph run, with a boolean indication /// whether it is separated by a space form the preceding glyph run. /// internal string NextGlyphContent(out bool inline, out uint lcid) { // Right now, we use the simplest possible heuristic for // spacing glyph runs: All pairs of adjacent glyph runs are assumed // to be separated by a word break. inline = false; lcid = 0; // End of page? if (_nextGlyphRun >= _fixedPageInfo.GlyphRunCount) { return null; } // Retrieve inline, lcid and return value from the next glyph run info. GlyphRunInfo glyphRunInfo = _fixedPageInfo.GlyphRunAtPosition(_nextGlyphRun); lcid = glyphRunInfo.LanguageID; // Point to the next glyph run for the next call and return. ++_nextGlyphRun; return glyphRunInfo.UnicodeString; } #endregion Internal Methods //------------------------------------------------------ // // Internal Properties // //------------------------------------------------------ #region Internal Properties ////// Indicates whether no more content can be returned. /// internal bool AtEndOfPage { get { return _nextGlyphRun >= _fixedPageInfo.GlyphRunCount; } } #endregion Internal Properties //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ #region Private Fields private XmlFixedPageInfo _fixedPageInfo; private int _nextGlyphRun; #endregion Private Fields } } // 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: // Given a DOM node for a fixed page, enumerates its text content. // // History: // 05/11/2004: JohnLarc: Initial implementation //--------------------------------------------------------------------------- using System; using System.Xml; namespace MS.Internal.IO.Packaging { ////// Implements a sequence of (textContent, precedingDelimiter) pairs for /// a fixed page node. /// internal class FixedPageContentExtractor { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors ////// Initialize a FixedPageContentExtractor from a DOM node. /// internal FixedPageContentExtractor(XmlNode fixedPage) { _fixedPageInfo = new XmlFixedPageInfo(fixedPage); _nextGlyphRun = 0; } #endregion Constructors //------------------------------------------------------ // // Internal Methods // //----------------------------------------------------- #region Internal Methods ////// Return the content of the next glyph run, with a boolean indication /// whether it is separated by a space form the preceding glyph run. /// internal string NextGlyphContent(out bool inline, out uint lcid) { // Right now, we use the simplest possible heuristic for // spacing glyph runs: All pairs of adjacent glyph runs are assumed // to be separated by a word break. inline = false; lcid = 0; // End of page? if (_nextGlyphRun >= _fixedPageInfo.GlyphRunCount) { return null; } // Retrieve inline, lcid and return value from the next glyph run info. GlyphRunInfo glyphRunInfo = _fixedPageInfo.GlyphRunAtPosition(_nextGlyphRun); lcid = glyphRunInfo.LanguageID; // Point to the next glyph run for the next call and return. ++_nextGlyphRun; return glyphRunInfo.UnicodeString; } #endregion Internal Methods //------------------------------------------------------ // // Internal Properties // //------------------------------------------------------ #region Internal Properties ////// Indicates whether no more content can be returned. /// internal bool AtEndOfPage { get { return _nextGlyphRun >= _fixedPageInfo.GlyphRunCount; } } #endregion Internal Properties //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ #region Private Fields private XmlFixedPageInfo _fixedPageInfo; private int _nextGlyphRun; #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
- RichTextBox.cs
- Viewport3DVisual.cs
- ReplacementText.cs
- ValidationResult.cs
- StyleModeStack.cs
- InternalConfigConfigurationFactory.cs
- HttpContextWrapper.cs
- SettingsPropertyCollection.cs
- DynamicPropertyHolder.cs
- DependencyObject.cs
- Transform3D.cs
- SystemParameters.cs
- DetailsViewPagerRow.cs
- BaseProcessProtocolHandler.cs
- HttpDebugHandler.cs
- PathGradientBrush.cs
- MetricEntry.cs
- MimeBasePart.cs
- ExtensionDataReader.cs
- oledbmetadatacollectionnames.cs
- RequestValidator.cs
- SoapObjectInfo.cs
- ADMembershipProvider.cs
- Encoder.cs
- BindableTemplateBuilder.cs
- ValueProviderWrapper.cs
- SerializationInfo.cs
- DoubleAnimationUsingPath.cs
- MailDefinition.cs
- TextSegment.cs
- ZipIOFileItemStream.cs
- PackagePartCollection.cs
- Content.cs
- SqlRowUpdatingEvent.cs
- HighContrastHelper.cs
- Pair.cs
- InternalRelationshipCollection.cs
- ViewStateModeByIdAttribute.cs
- TextBoxAutomationPeer.cs
- SolidBrush.cs
- TickBar.cs
- PropertyInformationCollection.cs
- PrivilegeNotHeldException.cs
- RemotingClientProxy.cs
- BrowserTree.cs
- XmlComment.cs
- SessionKeyExpiredException.cs
- LiteralLink.cs
- XmlSchemaObject.cs
- Roles.cs
- StreamReader.cs
- FontNamesConverter.cs
- Parser.cs
- DocumentPaginator.cs
- Single.cs
- TimeBoundedCache.cs
- HighlightVisual.cs
- AutoScrollExpandMessageFilter.cs
- AsyncCompletedEventArgs.cs
- Viewport3DAutomationPeer.cs
- AssemblyUtil.cs
- ButtonField.cs
- ImageList.cs
- WebWorkflowRole.cs
- BaseComponentEditor.cs
- Rfc4050KeyFormatter.cs
- XPathQueryGenerator.cs
- IdentityReference.cs
- HtmlButton.cs
- PartBasedPackageProperties.cs
- PathSegment.cs
- TextSelectionHighlightLayer.cs
- AliasedSlot.cs
- PropertyGrid.cs
- MultiByteCodec.cs
- BinaryCommonClasses.cs
- TypeConstant.cs
- NotificationContext.cs
- SqlDataSourceConfigureSelectPanel.cs
- ServerValidateEventArgs.cs
- SiteMapNodeItem.cs
- MetadataPropertyAttribute.cs
- PrivilegeNotHeldException.cs
- FailedToStartupUIException.cs
- XPathScanner.cs
- ItemDragEvent.cs
- InlineObject.cs
- DesigntimeLicenseContext.cs
- WsrmFault.cs
- CatalogPart.cs
- MethodSignatureGenerator.cs
- ListComponentEditor.cs
- WindowsSlider.cs
- WebSysDefaultValueAttribute.cs
- TableItemPattern.cs
- Matrix.cs
- DesignerDataSchemaClass.cs
- Pair.cs
- GridView.cs
- VisualTreeUtils.cs