Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / MS / Internal / IO / Packaging / fixedPageContentExtractor.cs / 1305600 / 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
- LogicalChannelCollection.cs
- GroupStyle.cs
- TaskScheduler.cs
- DbResourceAllocator.cs
- LowerCaseStringConverter.cs
- BindingRestrictions.cs
- XmlHierarchyData.cs
- QueryOutputWriter.cs
- DataBinder.cs
- Highlights.cs
- IndexerReference.cs
- XmlDataLoader.cs
- ThicknessKeyFrameCollection.cs
- RenderingEventArgs.cs
- DockPattern.cs
- RTTrackingProfile.cs
- MobileListItem.cs
- DefaultAuthorizationContext.cs
- Touch.cs
- CollectionView.cs
- Debug.cs
- AsymmetricKeyExchangeFormatter.cs
- DeadLetterQueue.cs
- InputManager.cs
- WebPartMenu.cs
- TemplatedEditableDesignerRegion.cs
- Label.cs
- UnsafePeerToPeerMethods.cs
- LambdaCompiler.Statements.cs
- GeneralTransformCollection.cs
- WhitespaceReader.cs
- WindowsPrincipal.cs
- RightNameExpirationInfoPair.cs
- ToolStripContainer.cs
- IBuiltInEvidence.cs
- OpenTypeCommon.cs
- SoapSchemaExporter.cs
- EmptyStringExpandableObjectConverter.cs
- CallSiteOps.cs
- ValueType.cs
- StylusPointDescription.cs
- XPSSignatureDefinition.cs
- Latin1Encoding.cs
- CompressedStack.cs
- SmtpReplyReaderFactory.cs
- ErrorWebPart.cs
- XhtmlBasicCalendarAdapter.cs
- RegisteredArrayDeclaration.cs
- ChannelBinding.cs
- RefType.cs
- MethodImplAttribute.cs
- RC2.cs
- HwndAppCommandInputProvider.cs
- ByteStream.cs
- xmlfixedPageInfo.cs
- BuildResultCache.cs
- FontClient.cs
- MarkupCompilePass1.cs
- XmlSortKeyAccumulator.cs
- SwitchCase.cs
- Int64.cs
- SerTrace.cs
- TextDecoration.cs
- StatusStrip.cs
- coordinatorscratchpad.cs
- DataRecordInternal.cs
- WindowsTokenRoleProvider.cs
- CodeNamespaceCollection.cs
- OdbcHandle.cs
- StringStorage.cs
- _emptywebproxy.cs
- TextLineResult.cs
- HttpListener.cs
- SqlGatherConsumedAliases.cs
- BuilderInfo.cs
- WorkflowInstanceProxy.cs
- FixedSOMPageConstructor.cs
- HttpBrowserCapabilitiesBase.cs
- TypeHelpers.cs
- ObjectTokenCategory.cs
- RubberbandSelector.cs
- SchemaImporterExtensionsSection.cs
- InstanceDataCollection.cs
- CachingHintValidation.cs
- HotSpotCollectionEditor.cs
- PanningMessageFilter.cs
- RsaSecurityTokenAuthenticator.cs
- XsdBuildProvider.cs
- EventDescriptor.cs
- OverrideMode.cs
- EdmScalarPropertyAttribute.cs
- Size3D.cs
- ChannelDemuxer.cs
- RayMeshGeometry3DHitTestResult.cs
- TextEditorTables.cs
- XmlSchemaAll.cs
- SspiNegotiationTokenProvider.cs
- DataGridViewCellEventArgs.cs
- RemotingClientProxy.cs
- AuthenticateEventArgs.cs