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
- SecuritySessionServerSettings.cs
- AnnotationComponentChooser.cs
- ServerValidateEventArgs.cs
- TextBlockAutomationPeer.cs
- ObjectDataSource.cs
- SelectionListComponentEditor.cs
- TakeOrSkipWhileQueryOperator.cs
- CompoundFileStreamReference.cs
- StringFormat.cs
- PhoneCall.cs
- StringConverter.cs
- ComponentCommands.cs
- FillRuleValidation.cs
- ListArgumentProvider.cs
- LinqDataSourceUpdateEventArgs.cs
- SqlInternalConnectionTds.cs
- ElementsClipboardData.cs
- ItemContainerGenerator.cs
- BulletedList.cs
- ListenerPerfCounters.cs
- FilterException.cs
- DataGridLinkButton.cs
- VirtualDirectoryMapping.cs
- SHA384.cs
- RegexWriter.cs
- RoutedEvent.cs
- ConstructorArgumentAttribute.cs
- OracleDataReader.cs
- FillBehavior.cs
- TableRowsCollectionEditor.cs
- XmlIgnoreAttribute.cs
- Activator.cs
- StateWorkerRequest.cs
- FormParameter.cs
- CngAlgorithmGroup.cs
- XPathException.cs
- CheckBox.cs
- WebExceptionStatus.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- SoapAttributes.cs
- AuthenticationService.cs
- MethodBody.cs
- ClientOptions.cs
- ToolStripContainer.cs
- DataService.cs
- X509Utils.cs
- SafeRightsManagementHandle.cs
- FocusTracker.cs
- Win32Exception.cs
- XmlSchemaSimpleTypeList.cs
- CodeDOMProvider.cs
- ChtmlImageAdapter.cs
- DataSourceSelectArguments.cs
- PixelFormat.cs
- XmlAnyElementAttribute.cs
- PerformanceCounters.cs
- DoubleAnimationClockResource.cs
- ToolstripProfessionalRenderer.cs
- WebPartExportVerb.cs
- FixedSOMSemanticBox.cs
- HMACSHA512.cs
- BroadcastEventHelper.cs
- DependencyObjectValidator.cs
- SelectionGlyphBase.cs
- WMIInterop.cs
- CornerRadius.cs
- XmlSchemaAttributeGroupRef.cs
- DynamicResourceExtension.cs
- TiffBitmapDecoder.cs
- SqlUserDefinedAggregateAttribute.cs
- IsolatedStorageFile.cs
- Int16Storage.cs
- CryptographicAttribute.cs
- XmlSchemaValidationException.cs
- AttributeEmitter.cs
- LinearGradientBrush.cs
- WmpBitmapEncoder.cs
- MissingMemberException.cs
- SoapSchemaImporter.cs
- ProfileSettingsCollection.cs
- ScriptResourceHandler.cs
- AsyncOperationContext.cs
- LogicalExpr.cs
- SiteMapPath.cs
- SaveWorkflowAsyncResult.cs
- RuntimeArgumentHandle.cs
- SkipStoryboardToFill.cs
- WebHttpElement.cs
- _AutoWebProxyScriptHelper.cs
- ExceptionHandlerDesigner.cs
- InlinedAggregationOperator.cs
- RegexRunner.cs
- PersonalizationStateInfo.cs
- RewritingPass.cs
- SafeRightsManagementSessionHandle.cs
- PipelineModuleStepContainer.cs
- SelectionChangedEventArgs.cs
- XmlAtomicValue.cs
- MobileUserControlDesigner.cs
- Evidence.cs