Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- FigureHelper.cs
- PageHandlerFactory.cs
- HttpCookiesSection.cs
- SpellerHighlightLayer.cs
- CustomLineCap.cs
- DbConnectionClosed.cs
- TypeNameHelper.cs
- Stroke.cs
- StreamInfo.cs
- AuthenticationServiceManager.cs
- XmlSchemaIdentityConstraint.cs
- CodeCompileUnit.cs
- SynchronousReceiveBehavior.cs
- ImportOptions.cs
- WebBrowserUriTypeConverter.cs
- XmlQueryType.cs
- ReadOnlyHierarchicalDataSource.cs
- SocketException.cs
- ScaleTransform.cs
- View.cs
- Line.cs
- ISFClipboardData.cs
- ObjectListCommandEventArgs.cs
- codemethodreferenceexpression.cs
- DataGridViewCheckBoxCell.cs
- StatusBar.cs
- NamespaceList.cs
- MembershipSection.cs
- VisualStyleElement.cs
- MethodCallExpression.cs
- ConnectionConsumerAttribute.cs
- SettingsContext.cs
- PrintControllerWithStatusDialog.cs
- Simplifier.cs
- CaseInsensitiveComparer.cs
- TypeInfo.cs
- VirtualizingStackPanel.cs
- ApplicationSecurityInfo.cs
- Journaling.cs
- AnnotationObservableCollection.cs
- BaseCAMarshaler.cs
- DrawingBrush.cs
- TextBounds.cs
- WSFederationHttpBindingCollectionElement.cs
- PeerApplicationLaunchInfo.cs
- ExtensionElementCollection.cs
- XamlPoint3DCollectionSerializer.cs
- MetabaseServerConfig.cs
- CurrentChangedEventManager.cs
- NetworkInformationPermission.cs
- SafeCoTaskMem.cs
- TargetInvocationException.cs
- FileDialogCustomPlace.cs
- RecordManager.cs
- DaylightTime.cs
- WebMessageEncodingElement.cs
- ReadOnlyHierarchicalDataSourceView.cs
- MultiView.cs
- SmiXetterAccessMap.cs
- PhysicalAddress.cs
- WinFormsSecurity.cs
- NativeActivityAbortContext.cs
- RoutedEventValueSerializer.cs
- InstalledVoice.cs
- KeyedCollection.cs
- Serializer.cs
- WCFBuildProvider.cs
- ContainsRowNumberChecker.cs
- Substitution.cs
- RestClientProxyHandler.cs
- RootBrowserWindowAutomationPeer.cs
- IgnorePropertiesAttribute.cs
- SafeNativeMethods.cs
- DropShadowEffect.cs
- WebExceptionStatus.cs
- UrlMappingsSection.cs
- GetCertificateRequest.cs
- DbModificationCommandTree.cs
- Array.cs
- TraceSwitch.cs
- StandardCommandToolStripMenuItem.cs
- TextServicesHost.cs
- TreeNodeSelectionProcessor.cs
- Membership.cs
- base64Transforms.cs
- MDIWindowDialog.cs
- SrgsText.cs
- Bezier.cs
- GPStream.cs
- WebSysDisplayNameAttribute.cs
- Debug.cs
- LostFocusEventManager.cs
- ProcessHost.cs
- StreamReader.cs
- Identity.cs
- FlowDocumentFormatter.cs
- XPathChildIterator.cs
- PropertyRecord.cs
- Validator.cs
- DigestTraceRecordHelper.cs