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
- TemplateNameScope.cs
- TextEditor.cs
- BamlStream.cs
- XamlNamespaceHelper.cs
- StringArrayConverter.cs
- FunctionParameter.cs
- HybridCollection.cs
- MarkupCompiler.cs
- _AutoWebProxyScriptHelper.cs
- ValidatedControlConverter.cs
- XmlILConstructAnalyzer.cs
- nulltextcontainer.cs
- NumericPagerField.cs
- Attributes.cs
- EpmCustomContentSerializer.cs
- XmlSerializerNamespaces.cs
- ListViewHitTestInfo.cs
- SecurityException.cs
- XslAstAnalyzer.cs
- AspCompat.cs
- ExpressionHelper.cs
- Tile.cs
- AvTraceDetails.cs
- RemoteWebConfigurationHostServer.cs
- ItemCheckedEvent.cs
- SystemWebCachingSectionGroup.cs
- DataKeyCollection.cs
- MemberAccessException.cs
- _SingleItemRequestCache.cs
- Table.cs
- RbTree.cs
- CustomError.cs
- EventProviderClassic.cs
- SymmetricSecurityProtocolFactory.cs
- FontWeight.cs
- ToolBarPanel.cs
- PointConverter.cs
- BinHexEncoder.cs
- BezierSegment.cs
- PropertyFilterAttribute.cs
- DesignParameter.cs
- BasePattern.cs
- SqlDataSourceWizardForm.cs
- SoapServerProtocol.cs
- MobileCategoryAttribute.cs
- GenericWebPart.cs
- Stylus.cs
- AnalyzedTree.cs
- ToolStripContainerActionList.cs
- SqlMultiplexer.cs
- ListViewInsertionMark.cs
- AutomationPeer.cs
- VirtualDirectoryMapping.cs
- BamlTreeUpdater.cs
- CrossSiteScriptingValidation.cs
- SemanticResultValue.cs
- ProgressChangedEventArgs.cs
- LinqDataSourceView.cs
- GridViewPageEventArgs.cs
- FormatterConverter.cs
- GridViewColumn.cs
- HtmlGenericControl.cs
- TextEditorThreadLocalStore.cs
- ErrorLog.cs
- WmpBitmapDecoder.cs
- CheckBox.cs
- ImageButton.cs
- DownloadProgressEventArgs.cs
- XpsPackagingPolicy.cs
- TextSelectionProcessor.cs
- DataTableCollection.cs
- DataGrid.cs
- RequestCachePolicy.cs
- ScalarType.cs
- ImportedNamespaceContextItem.cs
- PolicyManager.cs
- QueryRewriter.cs
- CodeTypeMemberCollection.cs
- XmlChoiceIdentifierAttribute.cs
- AmbiguousMatchException.cs
- DataBindingHandlerAttribute.cs
- DriveNotFoundException.cs
- ToolStrip.cs
- Fonts.cs
- CharStorage.cs
- CodeSubDirectoriesCollection.cs
- ConnectionInterfaceCollection.cs
- TreeNodeStyle.cs
- WmlTextViewAdapter.cs
- RemotingException.cs
- PeerNameRegistration.cs
- XamlToRtfWriter.cs
- XPathSelectionIterator.cs
- HttpBrowserCapabilitiesBase.cs
- AuthenticationManager.cs
- _SslStream.cs
- QueueProcessor.cs
- MatrixTransform.cs
- DataSysAttribute.cs
- CommandDevice.cs