Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- DataGridTable.cs
- BitConverter.cs
- RemoteWebConfigurationHostServer.cs
- StringResourceManager.cs
- TimeSpanSecondsConverter.cs
- FileDetails.cs
- SafeLibraryHandle.cs
- KnownBoxes.cs
- AppSettingsSection.cs
- SizeAnimationClockResource.cs
- DynamicVirtualDiscoSearcher.cs
- MarkupCompiler.cs
- MetricEntry.cs
- RenderContext.cs
- XsltLoader.cs
- DiscoveryClientProtocol.cs
- TagNameToTypeMapper.cs
- SafeCryptoHandles.cs
- DeclarativeCatalogPart.cs
- InvalidEnumArgumentException.cs
- _BaseOverlappedAsyncResult.cs
- Parser.cs
- SoapSchemaExporter.cs
- InheritanceRules.cs
- DrawingGroup.cs
- EventLogPermissionAttribute.cs
- PropertyTabChangedEvent.cs
- HiddenFieldPageStatePersister.cs
- XmlSchemaValidator.cs
- HandleCollector.cs
- PreservationFileWriter.cs
- Scheduling.cs
- HttpCacheVaryByContentEncodings.cs
- XPathNodeHelper.cs
- SatelliteContractVersionAttribute.cs
- DataSourceCache.cs
- TextRangeEditTables.cs
- Set.cs
- MailMessage.cs
- BinaryParser.cs
- CannotUnloadAppDomainException.cs
- Int16Animation.cs
- BatchStream.cs
- ObjectDataSourceFilteringEventArgs.cs
- FormViewDeleteEventArgs.cs
- ConversionContext.cs
- ClosableStream.cs
- Int64.cs
- xmlfixedPageInfo.cs
- MetadataSource.cs
- errorpatternmatcher.cs
- PersonalizableAttribute.cs
- HttpResponseWrapper.cs
- Tool.cs
- Win32Exception.cs
- TrustSection.cs
- ErrorEventArgs.cs
- QuaternionAnimation.cs
- KnownTypesProvider.cs
- TransformerInfo.cs
- XPathMultyIterator.cs
- HttpStreamFormatter.cs
- FlowDocumentView.cs
- TypeConverterHelper.cs
- XmlNode.cs
- ToolboxItemLoader.cs
- UrlPropertyAttribute.cs
- HitTestWithGeometryDrawingContextWalker.cs
- WebServiceTypeData.cs
- PtsPage.cs
- QueryStringParameter.cs
- ParallelTimeline.cs
- ChameleonKey.cs
- DataGridViewSortCompareEventArgs.cs
- TreeNodeStyle.cs
- ProviderBase.cs
- _CookieModule.cs
- XmlSubtreeReader.cs
- ApplicationTrust.cs
- WindowsSpinner.cs
- SamlNameIdentifierClaimResource.cs
- ClientTarget.cs
- ClientSideProviderDescription.cs
- ParameterRetriever.cs
- PriorityBinding.cs
- Pkcs9Attribute.cs
- SafeArrayTypeMismatchException.cs
- EntityDataSourceWrapper.cs
- XmlDocument.cs
- StrokeNodeEnumerator.cs
- ParameterCollection.cs
- ReceiveContextCollection.cs
- CfgParser.cs
- DataGridViewHeaderCell.cs
- ColorMatrix.cs
- CommandArguments.cs
- ControlsConfig.cs
- ExtendedProtectionPolicyTypeConverter.cs
- MobileTemplatedControlDesigner.cs
- ObjectDataSourceChooseMethodsPanel.cs